# Errors when Logstash is writing to InfluxDB

**URL:** <https://discuss.elastic.co/t/errors-when-logstash-is-writing-to-influxdb/87807>\
**Category:** Logstash\
**Created:** [May 31, 2017, 9:01pm UTC](https://discuss.elastic.co/t/errors-when-logstash-is-writing-to-influxdb/87807 "2017-05-31T21:01:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_1](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Steve\_1](https://discuss.elastic.co/u/Steve_1)\
**Post date:** [May 31, 2017, 9:01pm UTC](https://discuss.elastic.co/t/errors-when-logstash-is-writing-to-influxdb/87807/1 "2017-05-31T21:01:09Z")

</div>

Hi, I am going to send logs from Logstash to both Elasticsearch and InfluxDB.

This is logstash.conf:

```
input {
  beats {
    port => 5044
    ssl => false
    ssl_certificate => "..."
    ssl_key => "..."
  }
}

filter {
}

output {
  influxdb {
    data_points => {}
    host => "influxdb"
    db => "logstash"
  }
}

```

The problem is that I get errors when Logstash tries to write data to InfluxDB:

```
[2017-05-31T20:53:41,118][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2017-05-31T20:53:54,133][WARN][logstash.outputs.influxdb] Non recoverable exception while writing to InfluxDB {:exception=>nil}
[2017-05-31T20:53:54,805][WARN][logstash.outputs.influxdb] Non recoverable exception while writing to InfluxDB {:exception=>nil}

```

InfluxDB log shows:

```
[httpd] xxx.xx.x.xxx - - [31/May/2017:20:53:54 +0000] "POST /write?db=logstash&precision=ms&rp=autogen HTTP/1.1" 400 76 "-" "Ruby" 41f1e554-4643-11e7-8002-000000000000 2188
[httpd] xxx.xx.x.xxx - - [31/May/2017:20:53:54 +0000] "POST /write?db=logstash&precision=ms&rp=autogen HTTP/1.1" 400 6511 "-" "Ruby" 42591a26-4643-11e7-8003-000000000000 1363

```

Can anybody explain what could be a reason of such errors?

---

<div class="post-metadata">

**Author:** ![Steve\_1](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Steve\_1](https://discuss.elastic.co/u/Steve_1)\
**Post date:** [June 2, 2017, 4:24pm UTC](https://discuss.elastic.co/t/errors-when-logstash-is-writing-to-influxdb/87807/2 "2017-06-02T16:24:12Z")

</div>

@theuntergeek @magnusbaeck @Christian_Dahlqvist  
Any recommendations? Could the reason be in Logstash InfluxDB plugin and InfluxDB versions incompatibility?

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [June 6, 2017, 12:47am UTC](https://discuss.elastic.co/t/errors-when-logstash-is-writing-to-influxdb/87807/3 "2017-06-06T00:47:25Z")

</div>

I don't have any domain knowledge of influxdb, to be honest. The influxdb plugin was contributed by someone not on the Logstash team. While it could be some incompatibility, I would have to do a lot of digging to find out for sure.

I would raise an issue at [https://github.com/logstash-plugins/logstash-output-influxdb](https://github.com/logstash-plugins/logstash-output-influxdb)

---

<div class="post-metadata">

**Author:** ![Steve\_1](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Steve\_1](https://discuss.elastic.co/u/Steve_1)\
**Post date:** [June 6, 2017, 5:48pm UTC](https://discuss.elastic.co/t/errors-when-logstash-is-writing-to-influxdb/87807/4 "2017-06-06T17:48:51Z")

</div>

I got more info about the issue. Logstash logs say there is an error due to `invalid field format`.  
I send Metricbeat data to Logstash and then to InfluxDB in JSON format.

Any ideas what is that format issue about?

This is error log and Metricbeat data in Logstash.

```
"2017-06-06T17:29:41.676000+0000", :message=>"Error writing to InfluxDB", :response=>#<Manticore::Response:0x2dea8269 
@message="Bad Request", @callback_result="{\"error\":\"unable to parse 'logstash 1496770179090': 
invalid field format\\nunable to parse 'logstash 1496770179090': invalid field format\\nunable to parse 'logstash 1496770179091': 
invalid field format\\nunable to parse 'logstash 1496770179091': invalid field format\\nunable to parse 'logstash 1496770179091': 
invalid field format\\nunable to parse 'logstash 1496770179091': invalid field format\\nunable to parse 'logstash 1496770179091': 
...

{"@timestamp":"2017-06-06T17:29:39.091Z","type":"metricsets","system":{"process":{"ppid":2,"memory":{"size":0,"rss":{"bytes":0,"pct":0.000000},"share":0},
"state":"sleeping","fd":{"open":0,"limit":{"hard":4096,"soft":1024}},"pid":809,"username":"root","cpu":{"total":{"pct":0.000000},
"start_time":"2016-02-28T21:38:32.000Z"},"pgid":0,"name":"jbd2/dm-2-8"}},"metricset":{"module":"system","name":"process","rtt":106444},
"beat":{"name":"host_name","hostname":"host_name","version":"5.3.0"},"@version":"1",
"host":"host_name","tags":["beats_input_raw_event"]}{"type":"metricsets","system":{"process":{"name":"ext4-dio-unwrit","pgid":0,
"cpu":{"total":{"pct":0.000000},"start_time":"2016-02-28T21:38:32.000Z"},"fd":{"open":0,"limit":{"soft":1024,"hard":4096}},"ppid":2,"state":"sleeping",
"memory":{"size":0,"rss":{"bytes":0,"pct":0.000000},"share":0},"username":"root","pid":810}},"metricset":{"module":"system","name":"process","rtt":106444},
"beat":{"version":"5.3.0","name":"host_name","hostname":"host_name"},"@timestamp":"2017-06-06T17:29:39.091Z",
"@version":"1","host":"host_name","tags":["beats_input_raw_event"]}{"@timestamp":"2017-06-06T17:29:39.091Z","type":"metricsets",
"system":{"process":{"username":"root","memory":{"share":0,"size":0,"rss":{"bytes":0,"pct":0.000000}},"cpu":{"total":{"pct":0.000000},
"start_time":"2016-02-28T21:38:32.000Z"},"pid":849,"ppid":2,"fd":{"open":0,"limit":{"hard":4096,"soft":1024}},"pgid":0,"name":"kauditd","state":"sleeping"}},
"metricset":{"rtt":106444,"module":"system","name":"process"},"beat":{"name":"host_name","hostname":"host_name","version":"5.3.0"},
"@version":"1","host":"host_name","tags":["beats_input_raw_event"]}{"beat":{"version":"5.3.0","name":"host_name",
"hostname":"host_name"},"@timestamp":"2017-06-06T17:29:39.091Z","type":"metricsets","system":{"process":{"state":"sleeping","memory":
...
```

---

<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:** [July 4, 2017, 5:49pm UTC](https://discuss.elastic.co/t/errors-when-logstash-is-writing-to-influxdb/87807/5 "2017-07-04T17:49:17Z")

</div>

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