# Logstash + Telegraf

**URL:** <https://discuss.elastic.co/t/logstash-telegraf/283860>\
**Category:** Logstash\
**Created:** [September 10, 2021, 10:10am UTC](https://discuss.elastic.co/t/logstash-telegraf/283860 "2021-09-10T10:10:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hassen\_k](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hassen_k/32/46278_2.png) [@hassen\_k](https://discuss.elastic.co/u/hassen_k)\
**Post date:** [September 10, 2021, 10:10am UTC](https://discuss.elastic.co/t/logstash-telegraf/283860/1 "2021-09-10T10:10:23Z")

</div>

Hi,

I use Logstash to read a Kafka topic and to send the events to Influxdb. The events in the Kafka topic are sent by Telegraf.

Here are a example of events received from Kafka :

```auto
{
       "message" => "disk,all_servers=myserver,device=dm-0,fstype=xfs,host=myserver,mode=rw,path=/ used=55471497216i,used_percent=26.463792867611136,inodes_total=102400000i,inodes_free=102336513i,inodes_used=63487i,total=209612800000i,free=154141302784i 1631183074000000000\n",
      "@version" => "1",
    "@timestamp" => 2021-09-09T16:49:14.029Z
}
...
...
{
       "message" => "cpu,all_servers=myserver,cpu=cpu-total,host=myserver usage_user=4.694598687520277,usage_system=1.9182231197899142,usage_idle=92.57950530586864,usage_steal=0,usage_guest_nice=0,usage_nice=0,usage_iowait=0,usage_irq=0,usage_softirq=0.8076728925508541,usage_guest=0 1631183074000000000\n",
      "@version" => "1",
    "@timestamp" => 2021-09-09T16:49:14.029Z
}

```

To send the events to Influxdb, I use the http output

```auto
http {
    url => "http://xxx:xxx@localhost:8086/write?db=telegraf"
    http_method => "post"
    headers => ["Accept-Encoding: gzip", "Content-Encoding: gzip"]
    message => "%{[message]}"
    format => "message"
  }

```

It is working but it is very slow.

I tried to use the influxdb output :

```auto
influxdb {
    host => "localhost"
    port => 8086
    user => "xxx"
    password => "xxx"
    db => "telegraf"
    retention_policy => "autogen"
    use_event_fields_for_data_points => true
    exclude_fields => ["@timestamp","@version"]
    data_points => {}
  }

```

But it does not work. The events are consumed but not stored in Influxdb.

Any idea ?

M.

---

<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:** [October 8, 2021, 10:11am UTC](https://discuss.elastic.co/t/logstash-telegraf/283860/2 "2021-10-08T10:11:05Z")

</div>

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