# Configure Logstash to import json from REST and visualise a Time/Value-Chart in Kibana

**URL:** <https://discuss.elastic.co/t/configure-logstash-to-import-json-from-rest-and-visualise-a-time-value-chart-in-kibana/160355>\
**Category:** Logstash\
**Created:** [December 11, 2018, 11:16am UTC](https://discuss.elastic.co/t/configure-logstash-to-import-json-from-rest-and-visualise-a-time-value-chart-in-kibana/160355 "2018-12-11T11:16:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BugRogers](https://avatars.discourse-cdn.com/v4/letter/b/ecc23a/32.png) [@BugRogers](https://discuss.elastic.co/u/BugRogers)\
**Post date:** [December 11, 2018, 11:16am UTC](https://discuss.elastic.co/t/configure-logstash-to-import-json-from-rest-and-visualise-a-time-value-chart-in-kibana/160355/1 "2018-12-11T11:16:02Z")

</div>

Hi,

i'm trying to import a json-structure from a RESt-API into Elasticsearch. Then i want to create a line-chart from a time/value-pair.

In detail:

Json:

```
{
    "self":{
"href":"https://anUrl"
},
"version":2,
"values":[{
	"unit":"kWh",
	"time":"2018-11-26T23:15:00Z",
	"displayEnd":6.923634E7,
	"value":0.16,
	"displayStart":6.923617E7
},{
	"unit":"kWh",
	"time":"2018-11-26T23:30:00Z",
	"displayEnd":6.923651E7,
	"value":0.17,
	"displayStart":6.923634E7
} ...

```

Logstash-Config:

```
input { 
http_poller {
	urls => {
	  test => {
			method => get
			user => "xxx"
			password => "xxx"
			url => "http://anUrl"
			headers => {
			  Accept => "application/json"
			}
		}
	}
	
	request_timeout => 60
	schedule => { cron => "* * * * * UTC"}
	codec => "json"
	metadata_target => "http_poller_metadata"
    }
}

filter {
split {
	field => "values"
}

mutate {
	add_field => { 
                    # this is a test
		"value" => "%{[values][value]"
	}
	
}
}

output {
 elasticsearch {		
	hosts => ["127.0.0.1:9200"]
	index => "efficio"
 }

     stdout {
        codec => rubydebug
     }
}

```

The Values are in the "values"-array.  
In Kibana i want to create a line chart that displays on the x-axis the timestamps from json ("time") and on the y-axis the value of the timestamp ("value")

Thanks for your help!

---

<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:** [January 8, 2019, 11:16am UTC](https://discuss.elastic.co/t/configure-logstash-to-import-json-from-rest-and-visualise-a-time-value-chart-in-kibana/160355/2 "2019-01-08T11:16:16Z")

</div>

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