InfluxDB input plugin for logstash

I have got some other approach for connecting to influxDB as an input plugin :

input {
  http_poller {
    urls => {
      cpu => {
        user => "*****"
        password => "*****"
        url => "http://localhost:8086/query?pretty=true&db=inspectit&q=SELECT+*+FROM+cpu"
        headers => {
          Accept => "application/json
        }
     }  
    }
 }
}

filter {
split {
    field  => "results"
}
split {
    field  => "[results][series]"
}
split {
    field  => "[results][series][values]"
	
	
}
if[name]== "cpu"
{
	ruby 
	{

	 #event.set(event.get("[results][series][columns][0]"),event.get("[results][series][values][0])")
	  code => '
				
				 event.set(event.get("[results][series][columns][0]"),event.get("[results][series][values][0]"))
	
  '

	}
}
output{
 
stdout { codec => rubydebug }
}
2 Likes