# \#regex

**URL:** https://community.influxdata.com/tag/regex/36.md

[Latest](https://community.influxdata.com/latest.md) · [Categories](https://community.influxdata.com/categories.md) · [Tags](https://community.influxdata.com/tags.md)

---

## [Regex to change metric name](https://community.influxdata.com/t/regex-to-change-metric-name/57082)

<div class="topic-metadata">

**Author:** [@Rosario\_Iameo](https://community.influxdata.com/u/Rosario_Iameo)\
**Replies:** 1\
**Last updated:** [April 23, 2025, 2:08pm UTC](https://community.influxdata.com/t/regex-to-change-metric-name/57082 "2025-04-23T14:08:26Z")

</div>

Dear all, im going crazy to change change a metric name with regex processors. Im using the below code to change the “metricname” to "metricname\_alarms \[\[processors.regex\]\] \[\[processors.regex.metric\_rename\]\] ## …

---

## [Regex Processor Issues: Tag Not Appearing in Bucket](https://community.influxdata.com/t/regex-processor-issues-tag-not-appearing-in-bucket/39343)

<div class="topic-metadata">

**Author:** [@JAA](https://community.influxdata.com/u/JAA)\
**Replies:** 1\
**Last updated:** [November 21, 2024, 3:20am UTC](https://community.influxdata.com/t/regex-processor-issues-tag-not-appearing-in-bucket/39343 "2024-11-21T03:20:25Z")

</div>

Hi everyone! I’m having trouble using the Telegraf regex processor to extract and write a new tag into a test bucket. Current Situation: I successfully use the regex processor to extract a date from a string (OF) and …

---

## [Flux Variable in regex](https://community.influxdata.com/t/flux-variable-in-regex/13398)

<div class="topic-metadata">

**Author:** [@phillipprahl](https://community.influxdata.com/u/phillipprahl)\
**Replies:** 2\
**Last updated:** [October 23, 2024, 2:43pm UTC](https://community.influxdata.com/t/flux-variable-in-regex/13398 "2024-10-23T14:43:57Z")

</div>

Hey - Is it possible to use a variable in a regex filter? - Trying to do something like this: foo = “/cpu1|cpu2/” |\> filter … r.\_field =~ foo

---

## [Regex to select parts of a string](https://community.influxdata.com/t/regex-to-select-parts-of-a-string/37090)

<div class="topic-metadata">

**Author:** [@fastxl](https://community.influxdata.com/u/fastxl)\
**Replies:** 2\
**Last updated:** [September 17, 2024, 9:11pm UTC](https://community.influxdata.com/t/regex-to-select-parts-of-a-string/37090 "2024-09-17T21:11:29Z")

</div>

Not a regex expert, but I have a query that returns the following string. (\*\*MACHINE: OKUMA LB3000 \*)(\*\*DATE: 8/22/2024 \*)(\*\*W/O:W62502\*\*LOT:1\*\*OP:40 \*)(\*\*P/N:32205 \*) I can extract the value after W/O: with this regex…

---

## [Parsing an array from mqtt topic](https://community.influxdata.com/t/parsing-an-array-from-mqtt-topic/26630)

<div class="topic-metadata">

**Author:** [@oh2th](https://community.influxdata.com/u/oh2th)\
**Replies:** 7\
**Last updated:** [August 26, 2024, 12:58pm UTC](https://community.influxdata.com/t/parsing-an-array-from-mqtt-topic/26630 "2024-08-26T12:58:09Z")

</div>

I have a go-eCharger that can be managed also with MQTT. Two of the topics it send are arrays such as: go-eCharger/201397/nrg = \[233.74,2.48,3.41,1.24,0,0,0,0,0,0,0,0,0,0,0,0\] go-eCharger/201397/tma = \[35.5,30.5\] No I…

---

## [Performance of contains() is very bad compared to equivalent alternatives. Same thing for regex.compile()](https://community.influxdata.com/t/performance-of-contains-is-very-bad-compared-to-equivalent-alternatives-same-thing-for-regex-compile/34661)

<div class="topic-metadata">

**Author:** [@alexitheodore](https://community.influxdata.com/u/alexitheodore)\
**Replies:** 3\
**Last updated:** [July 8, 2024, 8:43pm UTC](https://community.influxdata.com/t/performance-of-contains-is-very-bad-compared-to-equivalent-alternatives-same-thing-for-regex-compile/34661 "2024-07-08T20:43:43Z")

</div>

I have many queries that I use in Grafana where I need to match based on a list of measurement names. In order to do this, I use a query like this: measurement\_names = \[ "some\_measurement\_name" , ... \] from(bucket: "…

---

## [Processors.regex.tags not working all the time](https://community.influxdata.com/t/processors-regex-tags-not-working-all-the-time/34665)

<div class="topic-metadata">

**Author:** [@tonic8](https://community.influxdata.com/u/tonic8)\
**Replies:** 2\
**Last updated:** [June 25, 2024, 7:20pm UTC](https://community.influxdata.com/t/processors-regex-tags-not-working-all-the-time/34665 "2024-06-25T19:20:30Z")

</div>

Hello on windows performance counter there is “User Input Delay per Process” that allow to evaluate reactivity response on process. i collect them and treat the data, using processors.regex.tags to clean up the data t…

---

## [Create an Array Variable and use this to filter](https://community.influxdata.com/t/create-an-array-variable-and-use-this-to-filter/33272)

<div class="topic-metadata">

**Author:** [@indi](https://community.influxdata.com/u/indi)\
**Replies:** 0\
**Last updated:** [February 19, 2024, 8:06pm UTC](https://community.influxdata.com/t/create-an-array-variable-and-use-this-to-filter/33272 "2024-02-19T20:06:08Z")

</div>

Dear Community, I’m trying to use an array as variable to filter after, as follow. The code below works but is too slow. ldevname = from(bucket: v.bucket) |\> range(start: -365d) |\> filter(fn: (r) =\> r.\_measurement …

---

## [How parse/regex CSV data when uploading with telegraf/inputs.tail?](https://community.influxdata.com/t/how-parse-regex-csv-data-when-uploading-with-telegraf-inputs-tail/29961)

<div class="topic-metadata">

**Author:** [@evsc](https://community.influxdata.com/u/evsc)\
**Replies:** 3\
**Last updated:** [July 24, 2023, 1:40pm UTC](https://community.influxdata.com/t/how-parse-regex-csv-data-when-uploading-with-telegraf-inputs-tail/29961 "2023-07-24T13:40:56Z")

</div>

My .csv file looks like this: Time,InnerTemp,OuterTemp, 2023-05-16 14:25:22,24.93℃,21.68℃, 2023-05-16 14:26:23,24.87℃,21.68℃, I am uploading it with telegraf and the \[\[inputs.tail\]\] plugin: \[\[inputs.tail\]\] files =…

---

## [Add key to the value of new key](https://community.influxdata.com/t/add-key-to-the-value-of-new-key/25933)

<div class="topic-metadata">

**Author:** [@do78](https://community.influxdata.com/u/do78)\
**Replies:** 1\
**Last updated:** [August 1, 2022, 2:18pm UTC](https://community.influxdata.com/t/add-key-to-the-value-of-new-key/25933 "2022-08-01T14:18:12Z")

</div>

Hello, I’m new to telegraf, and I try to find a way to rename specific tags to the same name, and add the original tag as a part of the value of the new tag, like: input agent\_host="hostA" agent\_ip="10.10.10.1" after …

---

## [What does metric\_rename mean?](https://community.influxdata.com/t/what-does-metric-rename-mean/25069)

<div class="topic-metadata">

**Author:** [@sezanzeb](https://community.influxdata.com/u/sezanzeb)\
**Replies:** 3\
**Last updated:** [May 17, 2022, 1:44pm UTC](https://community.influxdata.com/t/what-does-metric-rename-mean/25069 "2022-05-17T13:44:00Z")

</div>

I’m looking at the “Regex Processor Plugin”: telegraf/README.md at release-1.22 · influxdata/telegraf · GitHub The example there is not showing anything at all. Other plugins have a diff there, but this is just one sin…

---

## [Truncation with \[processors.regex\] of a multiline message does not work](https://community.influxdata.com/t/truncation-with-processors-regex-of-a-multiline-message-does-not-work/24577)

<div class="topic-metadata">

**Author:** [@nordlicht](https://community.influxdata.com/u/nordlicht)\
**Replies:** 1\
**Last updated:** [April 8, 2022, 11:50am UTC](https://community.influxdata.com/t/truncation-with-processors-regex-of-a-multiline-message-does-not-work/24577 "2022-04-08T11:50:11Z")

</div>

Hi, I would like to shorten the content of a multiline field from xxx characters. This regx works in a Regex Online Tester. (?m) (. {50}?). \*$ In the telegraph, however, each line is truncated after 50 characters: \[\[…

---

## [Telegraf custom grok pattern can not parse (?! regexp predicate](https://community.influxdata.com/t/telegraf-custom-grok-pattern-can-not-parse-regexp-predicate/22011)

<div class="topic-metadata">

**Author:** [@basic\_bl](https://community.influxdata.com/u/basic_bl)\
**Replies:** 1\
**Last updated:** [October 13, 2021, 3:17pm UTC](https://community.influxdata.com/t/telegraf-custom-grok-pattern-can-not-parse-regexp-predicate/22011 "2021-10-13T15:17:22Z")

</div>

In telegraf.conf tail plugin, writing custom grok pattern, can not parse (? ; but can work well if writing in ‘grok\_custom\_pattern\_files’ But to regexp predicate : (?! , cant not work well even writing in ‘grok\_custom…

---

## [Flux: regular expression capture groups](https://community.influxdata.com/t/flux-regular-expression-capture-groups/21905)

<div class="topic-metadata">

**Author:** [@abbradar](https://community.influxdata.com/u/abbradar)\
**Replies:** 3\
**Last updated:** [September 30, 2021, 4:01pm UTC](https://community.influxdata.com/t/flux-regular-expression-capture-groups/21905 "2021-09-30T16:01:58Z")

</div>

I’d like to match a string to a regular expression and use captured substring elsewhere, for example, /foo(\[a-z\]\*)bar/. AFAIU, there is currently no way to use capture groups in current regexp package. Is my understandin…

---

## [Using Regex in Starlark?](https://community.influxdata.com/t/using-regex-in-starlark/18246)

<div class="topic-metadata">

**Author:** [@Franky1](https://community.influxdata.com/u/Franky1)\
**Replies:** 2\
**Last updated:** [February 19, 2021, 8:32pm UTC](https://community.influxdata.com/t/using-regex-in-starlark/18246 "2021-02-19T20:32:38Z")

</div>

Is it somehow possible to use Regular Expressions in Starlark?

---

## [Error when parsing a url with \[\[processors.regex\]\]](https://community.influxdata.com/t/error-when-parsing-a-url-with-processors-regex/16800)

<div class="topic-metadata">

**Author:** [@theirman](https://community.influxdata.com/u/theirman)\
**Replies:** 1\
**Last updated:** [November 19, 2020, 7:46am UTC](https://community.influxdata.com/t/error-when-parsing-a-url-with-processors-regex/16800 "2020-11-19T07:46:46Z")

</div>

Hello I use the inputs.http plugin to recover data in json format as below : \[\[inputs.http\]\] urls = \[ "https://www.mon\_url.fr:4848/monitoring/domain/instance-production-1/applications/DistributeurWS/server/Distri…

---

## [Regexp as a variable in tick script](https://community.influxdata.com/t/regexp-as-a-variable-in-tick-script/15764)

<div class="topic-metadata">

**Author:** [@Neil\_Benton](https://community.influxdata.com/u/Neil_Benton)\
**Replies:** 1\
**Last updated:** [September 4, 2020, 5:58pm UTC](https://community.influxdata.com/t/regexp-as-a-variable-in-tick-script/15764 "2020-09-04T17:58:48Z")

</div>

Hi, I am trying to define a template script that uses a regular expression as part of the where clause. The following code works fine and filters out the data for the tags values that contain test. var filter = /test/ …

---

## [InfluxQL Select regex question](https://community.influxdata.com/t/influxql-select-regex-question/15635)

<div class="topic-metadata">

**Author:** [@Thib\_D](https://community.influxdata.com/u/Thib_D)\
**Replies:** 0\
**Last updated:** [August 18, 2020, 3:41pm UTC](https://community.influxdata.com/t/influxql-select-regex-question/15635 "2020-08-18T15:41:11Z")

</div>

Hi, I have a pretty simple request and I’m having trouble configuring it : All I want is to chose what will be the “fieldKey” resulting from my query Here are the name of the FIELD KEYS I’m querying name: cpu\_load fi…

---

## [StateDuration: Error exhausting result iterator; Err: failed to evaluate map function: unsupported binary expression invalid \>= int](https://community.influxdata.com/t/stateduration-error-exhausting-result-iterator-err-failed-to-evaluate-map-function-unsupported-binary-expression-invalid-int/14368)

<div class="topic-metadata">

**Author:** [@Ayrdrie](https://community.influxdata.com/u/Ayrdrie)\
**Replies:** 3\
**Last updated:** [July 30, 2020, 7:30pm UTC](https://community.influxdata.com/t/stateduration-error-exhausting-result-iterator-err-failed-to-evaluate-map-function-unsupported-binary-expression-invalid-int/14368 "2020-07-30T19:30:24Z")

</div>

I have this query and everytime it runs it is failing with this error failed to evaluate map function: unsupported binary expression invalid \>= int From the context of the error it doesn’t like the value of my state\_dura…

---

## [Addition of fields found with regex select clause](https://community.influxdata.com/t/addition-of-fields-found-with-regex-select-clause/14022)

<div class="topic-metadata">

**Author:** [@kielschwein](https://community.influxdata.com/u/kielschwein)\
**Replies:** 1\
**Last updated:** [April 24, 2020, 5:44pm UTC](https://community.influxdata.com/t/addition-of-fields-found-with-regex-select-clause/14022 "2020-04-24T17:44:08Z")

</div>

Hello, I’m working with influxdb only for some days and now I have a task that sounds simple but I don’t found a solution. I have one measurement with ~60 fields. Some of the fields store the number of items received f…

---

## [Custom pattern from grokdebug](https://community.influxdata.com/t/custom-pattern-from-grokdebug/13943)

<div class="topic-metadata">

**Author:** [@jlsam](https://community.influxdata.com/u/jlsam)\
**Replies:** 0\
**Last updated:** [April 21, 2020, 4:03am UTC](https://community.influxdata.com/t/custom-pattern-from-grokdebug/13943 "2020-04-21T04:03:56Z")

</div>

I created a pattern in https://grokdebug.herokuapp.com/ that uses a custom pattern (?\<offer\>haven't). To make this work in Telegraf, do I need to create a new pattern in grok\_custom\_patterns? Something like OFFER (?ha…

---

## [Using regular expressions (regex) in continuous query (and standard queries)](https://community.influxdata.com/t/using-regular-expressions-regex-in-continuous-query-and-standard-queries/13728)

<div class="topic-metadata">

**Author:** [@euphi](https://community.influxdata.com/u/euphi)\
**Replies:** 1\
**Last updated:** [April 5, 2020, 1:13pm UTC](https://community.influxdata.com/t/using-regular-expressions-regex-in-continuous-query-and-standard-queries/13728 "2020-04-05T13:13:47Z")

</div>

I’m trying to downsample all my data (in a specific database) with a continuous query including back-referencing as explained in https://docs.influxdata.com/influxdb/v1.7/query\_language/continuous\_queries/ . However, it…

---

## [How to exclude string from regex](https://community.influxdata.com/t/how-to-exclude-string-from-regex/10039)

<div class="topic-metadata">

**Author:** [@ajaypabba](https://community.influxdata.com/u/ajaypabba)\
**Replies:** 3\
**Last updated:** [June 7, 2019, 6:56pm UTC](https://community.influxdata.com/t/how-to-exclude-string-from-regex/10039 "2019-06-07T18:56:03Z")

</div>

Hi Team, How to exclude the string from regerx pattern ? Can any one please suggest me here ? gb\_nsms\_\*\_ABC\_file.log Here i want to exclude “EM” in the place of star ( “\*” ) …thanks in Advance…

---

## [Exclude one of the log line name from logparser](https://community.influxdata.com/t/exclude-one-of-the-log-line-name-from-logparser/10023)

<div class="topic-metadata">

**Author:** [@ajaypabba](https://community.influxdata.com/u/ajaypabba)\
**Replies:** 0\
**Last updated:** [June 5, 2019, 11:49am UTC](https://community.influxdata.com/t/exclude-one-of-the-log-line-name-from-logparser/10023 "2019-06-05T11:49:02Z")

</div>

Hi Team, I have one log parser its reading the loglines from mutiple log files… below is the example of log parser. “/abc/log/$ENV/xyz\_abc\_\_xyz\_file.log" ( "” will pick all log files , but i want to skip one file) …

---

## [From Laravel to Chronograph Log Viewer - Date Parsing Issue](https://community.influxdata.com/t/from-laravel-to-chronograph-log-viewer-date-parsing-issue/8981)

<div class="topic-metadata">

**Author:** [@ppataki](https://community.influxdata.com/u/ppataki)\
**Replies:** 4\
**Last updated:** [March 13, 2019, 9:21am UTC](https://community.influxdata.com/t/from-laravel-to-chronograph-log-viewer-date-parsing-issue/8981 "2019-03-13T09:21:43Z")

</div>

Hello there, I’m trying to use the Log Viewer from Chronograph to view my custom app logs. I’m aware that the datas sent to InfluxDb needs to be in syslog format to be shown in the UI. The logs are written in a specif…

---

## [Can telegraf processor Regex replace by empty string?](https://community.influxdata.com/t/can-telegraf-processor-regex-replace-by-empty-string/8881)

<div class="topic-metadata">

**Author:** [@keepgoing147](https://community.influxdata.com/u/keepgoing147)\
**Replies:** 3\
**Last updated:** [March 6, 2019, 10:03am UTC](https://community.influxdata.com/t/can-telegraf-processor-regex-replace-by-empty-string/8881 "2019-03-06T10:03:48Z")

</div>

Hi, I was wondering if telegraf processor ‘Regex’ can replace regex matched string with blank or not, I try to leave replacement field blank, but seems not working, is there any way to do this?

---

## [Need help on grok pattern](https://community.influxdata.com/t/need-help-on-grok-pattern/8443)

<div class="topic-metadata">

**Author:** [@ajaypabba](https://community.influxdata.com/u/ajaypabba)\
**Replies:** 6\
**Last updated:** [February 6, 2019, 2:23pm UTC](https://community.influxdata.com/t/need-help-on-grok-pattern/8443 "2019-02-06T14:23:22Z")

</div>

Hi guys… Need your help to prepare grok pattern for below. Totaltime=12:47.033s Appreciated your help…

---

## [Regex measurements starting with some text is not working -FLUX](https://community.influxdata.com/t/regex-measurements-starting-with-some-text-is-not-working-flux/8162)

<div class="topic-metadata">

**Author:** [@gowrisankar22](https://community.influxdata.com/u/gowrisankar22)\
**Replies:** 2\
**Last updated:** [January 21, 2019, 3:47am UTC](https://community.influxdata.com/t/regex-measurements-starting-with-some-text-is-not-working-flux/8162 "2019-01-21T03:47:35Z")

</div>

We have many measurements starting with say for an example “alert”. I am trying to regex with “alert” in flux language. but it is not working. Influxdb version: 1.7.2 curl localhost:8086/api/v2/query -XPOST -sS -H ‘ac…
