# Insert into influx on match

**URL:** <https://discuss.elastic.co/t/insert-into-influx-on-match/84328>\
**Category:** Logstash\
**Created:** [May 2, 2017, 9:04pm UTC](https://discuss.elastic.co/t/insert-into-influx-on-match/84328 "2017-05-02T21:04:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bob\_monty](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bob_monty/32/102434_2.png) [@bob\_monty](https://discuss.elastic.co/u/bob_monty)\
**Post date:** [May 2, 2017, 9:04pm UTC](https://discuss.elastic.co/t/insert-into-influx-on-match/84328/1 "2017-05-02T21:04:13Z")

</div>

Greetings  
i have data being collected by logstash and depending on the string match i will insert into one influx or another for example:

> if [@influx\_measurement] =~ /(ABC\_.\*)  
> then insert into influxA etc...

bit i need to add something more like:

> if [@influx\_measurement] =~ /(ABC\_._) and TAG VALUES (name) FROM /(ABC._) == serverA  
> then insert into influxB etc...

Just basically depending that if a tag value from key "name" in measurement (ABC.\*) matches "serverA" then insert into influx instanceB. help please?  
Thanks again

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [May 6, 2017, 7:13pm UTC](https://discuss.elastic.co/t/insert-into-influx-on-match/84328/2 "2017-05-06T19:13:49Z")

</div>

> Just basically depending that if a tag value from key "name" in measurement (ABC.\*) matches "serverA" then insert into influx instanceB.

I'm not sure exactly what you mean. What does an example `@influx_measurement` value look like and how do you want it filtered?

---

<div class="post-metadata">

**Author:** ![bob\_monty](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bob_monty/32/102434_2.png) [@bob\_monty](https://discuss.elastic.co/u/bob_monty)\
**Post date:** [May 15, 2017, 4:29pm UTC](https://discuss.elastic.co/t/insert-into-influx-on-match/84328/3 "2017-05-15T16:29:29Z")

</div>

hi Magnus  
im new to this so let me try to clarify. right now i have, if the measurement name coming from logstash match ABC\_\* something etc...then insert data into instance A of influx, but what i need is something like if the measurement name matches ABC\_\* and the key "NAME" in measurement ABC\_\* has the value "serverB" then insert into instance B of influx. not sure if that helps describe what i need . The data looks like:

```
ABC_SERVERS - that's the measurement NAME
key = host
value = serverB
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [May 15, 2017, 6:09pm UTC](https://discuss.elastic.co/t/insert-into-influx-on-match/84328/4 "2017-05-15T18:09:34Z")

</div>

I still don't understand what your events look like so I can't make suggestions for how to filter them. _Show_ your events, don't _describe_ them.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 12, 2017, 6:23pm UTC](https://discuss.elastic.co/t/insert-into-influx-on-match/84328/5 "2017-06-12T18:23:02Z")

</div>

Closed on June 12, 2017, 6:23pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
