UNSOLVED

Reid3

updated

10 years ago

R

Reid3

14 Posts

1

869

March 10th, 2016 09:00

ViPR SRM Data Enrichment - Using backreferences with regex

Can I use regex matching backreferences in the enriched property fields?

I have some situations where I would like to utilize a regular expression match on a key value and have part of the matched portion be able to be backreferenced as part of the property that is written to the database.  I'd like to use normal regex matching with parenthesis to define a variable that could be used in the property definition.

For example, I'd like to replace a path of an Isilon quota with the publicly accessible UNC (the path that makes sense to users).  Here is a screenshot of what I am trying to do (see the $1 in the property field where I am trying to use the backreference):

Isilon-data-enrichment-regex.PNG.png

Is there any way to do what I am trying to do with a regex?  If not, is this a good idea for an enhancement request to the product?

Thanks,
REID

  • Flo_csI

    2 Intern

    167 Posts

    359

    1

    Posted March 16th, 2016 02:00

    Hi Reid,

    I'm not sure we can achieve what you want with a data-enrichment / PTF. A variable-handling-filter with a property-extraction-handler is probably a better tool.

    Nevertheless, via file edition (not the GUI) here an example of post-processing to manipulate the enrichment using regex.

    In this example take the path & extract the last directory name to put it in uncpath property.

    In /opt/APG/Collecting/Property-Tagging-Filter/Load-Balancer/conf/property-tagging-filter.xml you can add.

    http://www.watch4net.com/APG/Filter/PropertyTaggingFilter ">

        60

       

           

               

                    http://your-frontend:58080/APG-WS/wsapi/db

                    ws-user

                    watch4net

                    device parttype part part

                    source=='Isilon-Collector' & parttype='Quota'

                   

                           

                   

               

                ,

                **

                @@

               

                    device

                    parttype

                    part

               

               

                    uncpath

               

           

       

    Let me know if that helps.