As of the upcoming release of Kapacitor 1.1 string manipulation functions 
have been added.

The function you are probably interested in is the `regexReplace` function.

It works like this:

|eval(lambda: regexReplace(/^.*-(\w\+)_.*$/, "raw_tag", '$1'))
     .as('value2')

See https://golang.org/pkg/regexp/#Regexp.ReplaceAllString for more details 
on the exact semantics of the regex and capture groups.

A release candidate version of version 1.1 is available on the downloads 
page https://www.influxdata.com/downloads/#kapacitor


On Friday, November 4, 2016 at 1:24:41 AM UTC-6, Sean Beckett wrote:
>
> You can write a UDF 
> <https://github.com/influxdata/kapacitor/tree/master/udf/agent> to do 
> whatever you like, but neither Kapacitor nor InfluxDB have built-in string 
> functions of any kind.
>
> On Thu, Nov 3, 2016 at 11:43 PM, Sai Birada <[email protected] 
> <javascript:>> wrote:
>
>> I had a tag value stored similar to value1-value2_value3-value4. Now I 
>> want to parse this string into multiple values and use those values to 
>> redirect data into various measurements. For example the datapoints with 
>> value1-value2_value3-value4 tag should go to measurement value2. Is there a 
>> way in kapacitor to parse a string and use its parsed tokens?
>>
>> -- 
>> Remember to include the version number!
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "InfluxData" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/influxdb.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/influxdb/3ee928e1-3200-4158-ac6b-0510e5a70c56%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/influxdb/3ee928e1-3200-4158-ac6b-0510e5a70c56%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Sean Beckett
> Director of Support and Professional Services
> InfluxDB
>

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/f0bf9c5d-2df8-40ed-b709-ecbad7271f9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to