# Sending check results to influxdb

**URL:** <https://discourse.sensu.io/t/sending-check-results-to-influxdb/882>\
**Category:** Sensu Classic (EOL)\
**Created:** [March 5, 2018, 11:44pm UTC](https://discourse.sensu.io/t/sending-check-results-to-influxdb/882 "2018-03-05T23:44:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cmeisinger](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Cmeisinger](https://discourse.sensu.io/u/Cmeisinger)\
**Post date:** [March 5, 2018, 11:44pm UTC](https://discourse.sensu.io/t/sending-check-results-to-influxdb/882/1 "2018-03-05T23:44:22Z")

</div>

Howdy!

So I’d like to do the following, but I don’t see a “good way” to do this.

I would like to take the result from every check on every iteration and send the return 0/1/2 to influxdb for graphing and analisys.

This is to allow for dashboards for trending uptime of specific checks over a long duration of time in order to do check uptime reports.

I do _not_ want to do the metrics based collection/sending as that is handled via telegraf already. I do not want to double-up there.

There seems to be a lack of documentation for doing something like this.

Does anyone have any pointers or places to start?

Thank you!

Chris

---

<div class="post-metadata">

**Author:** ![Shanker\_Balan](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/shanker_balan/32/84_2.png) [@Shanker\_Balan](https://discourse.sensu.io/u/Shanker_Balan)\
**Post date:** [March 6, 2018, 4:17am UTC](https://discourse.sensu.io/t/sending-check-results-to-influxdb/882/2 "2018-03-06T04:17:46Z")

</div>

Hi Chris,

Comments inline.

> Howdy!
> 
> So I'd like to do the following, but I don't see a "good way" to do this.
> 
> I would like to take the result from every check on every iteration and send the return 0/1/2 to influxdb for graphing and analisys.
> 
> This is to allow for dashboards for trending uptime of specific checks over a long duration of time in order to do check uptime reports.
> 
> I do \_not\_ want to do the metrics based collection/sending as that is handled via telegraf already. I do not want to double-up there.

I too started out with InfluxDB and later moved to filebeat+Elasticsearch based on inputs from this list.

> There seems to be a lack of documentation for doing something like this.
> 
> Does anyone have any pointers or places to start?

My setup is as follows:

- Run Filebeat on the sensu-server logs to feed Logstash. Since sensu-server logs are  
already in JSON, no additional parsing required

filebeat.prospectors:

# Each - is a prospector. Most options can be set at the prospector level, so  
# you can use different prospectors for various configurations.  
# Below are the prospector specific configurations.

- type: log  
&nbsp;&nbsp;paths:  
&nbsp;&nbsp;- /var/log/sensu/sensu-server.log  
&nbsp;&nbsp;enabled: true  
&nbsp;&nbsp;tags: ["json", "sensu"]  
&nbsp;&nbsp;json.keys\_under\_root: true  
&nbsp;&nbsp;json.add\_error\_key: true

- In Logstash, I drop everything other than “processing events” which are sent to ElasticSearch

filter {

&nbsp;&nbsp;if "sensu" in [tags] {  
&nbsp;&nbsp;&nbsp;&nbsp;if [message] == "processing event" {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;date {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match =\> ["[event][timestamp]", "UNIX"]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;remove\_field =\> [  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"offset",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"prospector",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"source",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"timestamp",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"[event][client][message]",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"[event][client][redact]",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"[event][client][socket]",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"[event][client][subscriptions]",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"[event][timestamp]",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"[event][client][version]"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;add\_tag =\> ["ts\_updated"]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;} else {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;drop { }  
&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;}

}

- Once events are in ES, then write custom Grafana dashboards or use Kibana visualisation. I prefer  
Grafana as I can use mixed data sources (ELK+Prometheus) for my Sensu Analytics dashboard.

Regards.  
@shankerbalan

> **···**
>
> > On 06-Mar-2018, at 05:14, cmeisinger@thecitybase.com wrote:

---

<div class="post-metadata">

**Author:** ![Steve\_Viola](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@Steve\_Viola](https://discourse.sensu.io/u/Steve_Viola)\
**Post date:** [March 6, 2018, 3:08pm UTC](https://discourse.sensu.io/t/sending-check-results-to-influxdb/882/3 "2018-03-06T15:08:55Z")

</div>

Chris,

I believe what you are looking for is built into the [influx/sensu extension](https://github.com/sensu-extensions/sensu-extensions-influxdb2). Make sure you’re loading influxdb2 from rubygems, since there’s as similar package which doesn’t have what you’re looking for. [This is the configuration](https://github.com/sensu-extensions/sensu-extensions-influxdb2#extension-not-a-handler) for loading the gem, and to get what you want, you’ll need to explicitly include the sensu-extensions-history part.

In Influx, you should see the checks come through as sensu.checks.$check\_name. If you want the $check\_name as the tag and not part of the measurement, check out [the Readme regarding enhanced\_history](https://github.com/sensu-extensions/sensu-extensions-influxdb2#other-attributes).

Hope that works out for you. Let me know if you have any questions,

Cheers

> **···**
>
> On Mon, Mar 5, 2018 at 6:44 PM, [cmeisinger@thecitybase.com](mailto:cmeisinger@thecitybase.com) wrote:
> 
> > Howdy!
> > 
> > So I’d like to do the following, but I don’t see a “good way” to do this.
> > 
> > I would like to take the result from every check on every iteration and send the return 0/1/2 to influxdb for graphing and analisys.
> > 
> > This is to allow for dashboards for trending uptime of specific checks over a long duration of time in order to do check uptime reports.
> > 
> > I do _not_ want to do the metrics based collection/sending as that is handled via telegraf already. I do not want to double-up there.
> > 
> > There seems to be a lack of documentation for doing something like this.
> > 
> > Does anyone have any pointers or places to start?
> > 
> > Thank you!
> > 
> > Chris
> 
> –
> 
> Steven Viola

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [November 22, 2018, 2:08am UTC](https://discourse.sensu.io/t/sending-check-results-to-influxdb/882/4 "2018-11-22T02:08:01Z")

</div>

Closed on November 22, 2018, 2:08am UTC


