# Json Input in Kibana

**URL:** <https://discuss.elastic.co/t/json-input-in-kibana/97136>\
**Category:** Kibana\
**Created:** [August 15, 2017, 4:56pm UTC](https://discuss.elastic.co/t/json-input-in-kibana/97136 "2017-08-15T16:56:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lidiya\_Chernova](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lidiya_chernova/32/21140_2.png) [@Lidiya\_Chernova](https://discuss.elastic.co/u/Lidiya_Chernova)\
**Post date:** [August 15, 2017, 4:56pm UTC](https://discuss.elastic.co/t/json-input-in-kibana/97136/1 "2017-08-15T16:56:32Z")

</div>

Hi there!  
How can I use Json Input in visualizations? More than this example: { "script" : "doc['grade'].value \* 1.2" } I haven't find. Do you have some more examples of using Json Input?

My task:

- List item I have documents with @timestamp in ElasticSearch, I need to get just documents with time period between 0 a.m and 8.a.m.

- List item I have already created Scripted field (hourOfDay) which shows only TIME from @timestamp field.  
But unfortunately filter with this Scripted field doesn't work..

Do you have any recommendations how can I get needed result?

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [August 16, 2017, 10:38am UTC](https://discuss.elastic.co/t/json-input-in-kibana/97136/2 "2017-08-16T10:38:01Z")

</div>

You can paste JSON-based Elasticsearch DSL queries in the search bar at the top of the screen. The following one-liner, pasted in the search bar will give you the desired results:

`{ "script": { "script": { "inline": "doc['@timestamp'].date.getHourOfDay() >= params.min && doc['@timestamp'].date.getHourOfDay() < params.max", "params": { "min": 0, "max": 8 } } } }`

Be careful though, scripted queries are computationally expensive.

---

<div class="post-metadata">

**Author:** ![Lidiya\_Chernova](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lidiya_chernova/32/21140_2.png) [@Lidiya\_Chernova](https://discuss.elastic.co/u/Lidiya_Chernova)\
**Post date:** [August 21, 2017, 11:40am UTC](https://discuss.elastic.co/t/json-input-in-kibana/97136/3 "2017-08-21T11:40:16Z")

</div>

Thx, Abdon! It works correctly!

---

<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:** [September 18, 2017, 11:40am UTC](https://discuss.elastic.co/t/json-input-in-kibana/97136/4 "2017-09-18T11:40:31Z")

</div>

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