# Data\_points is mandatory, what is the syntaxe to pass fields to influxDB

**URL:** <https://discuss.elastic.co/t/data-points-is-mandatory-what-is-the-syntaxe-to-pass-fields-to-influxdb/222132>\
**Category:** Logstash\
**Created:** [March 4, 2020, 5:21pm UTC](https://discuss.elastic.co/t/data-points-is-mandatory-what-is-the-syntaxe-to-pass-fields-to-influxdb/222132 "2020-03-04T17:21:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeanflorentine](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jeanflorentine](https://discuss.elastic.co/u/jeanflorentine)\
**Post date:** [March 4, 2020, 5:21pm UTC](https://discuss.elastic.co/t/data-points-is-mandatory-what-is-the-syntaxe-to-pass-fields-to-influxdb/222132/1 "2020-03-04T17:21:11Z")

</div>

Cannot find the syntax to get the fields passed to influxDB

my K8S message I got through Kafka input end like (of course each message has different values:  
"fields":{"env":"caa-hors-prod","cluster\_name":"hprd","client":"caa"}}

I have tried ::  
data\_points =\> {"field\_env" =\> "%{[env]}"  
"field\_cluster\_name" =\> "%{[cluster\_name]}"  
"field\_client" =\> "%{[client]}"}  
and  
data\_points =\> {"field\_env" =\> "%{env}"  
"field\_cluster\_name" =\> "%{cluster\_name}"  
"field\_client" =\> "%{client}"}

and  
data\_points =\> {"field\_env" =\> "%env"  
"field\_cluster\_name" =\> "%cluster\_name"  
"field\_client" =\> "%client"

In all case what I retrieve in InfluxDV , is the litteral field name, eg::  
"%{[env]}" or "%{env}" or "%{env}"

when I am expecting in this case :: the value "caa-hors-prod"

How to say that I want to see the field "env" as column "env" in InfluxDB ???  
or an other way how can I transfert all the input fields to InfluxDB output ???  
I tried the line ::  
data\_points =\>{}  
but it yelds errors in Logstash::  
[2020-03-04T17:58:09,314][WARN][logstash.outputs.influxdb] Non recoverable exception while writing to InfluxDB {:exception=\>#\<InfluxDB::Error: {"error":"unable to parse 'K8S\_E4 1583324018188': invalid field

A last one, with this ending JSON message:  
"reference":{"env":"caa-hors-prod","cluster\_name":"hprd","client":"caa"}}

the fields: "env", "cluster\_name" and "client" are encapsulated in tag "reference"  
how do you express this field "env" encapsulated in tag "reference" knowing that  
they are other fields "env" encapsulated elsewhere in the JSON message ???

Somebody can help , please ?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 4, 2020, 5:27pm UTC](https://discuss.elastic.co/t/data-points-is-mandatory-what-is-the-syntaxe-to-pass-fields-to-influxdb/222132/2 "2020-03-04T17:27:48Z")

</div>

> [@jeanflorentine](#):
>
> how do you express this field "env" encapsulated in tag "reference"

In a sprintf reference you would use %{[reference][env]}

In your first example you appear to have [fields][env], not just [env].

---

<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:** [April 1, 2020, 5:27pm UTC](https://discuss.elastic.co/t/data-points-is-mandatory-what-is-the-syntaxe-to-pass-fields-to-influxdb/222132/3 "2020-04-01T17:27:53Z")

</div>

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