# JSON Input - get RIGHT characters from string

**URL:** <https://discuss.elastic.co/t/json-input-get-right-characters-from-string/153547>\
**Category:** Kibana\
**Created:** [October 23, 2018, 8:35am UTC](https://discuss.elastic.co/t/json-input-get-right-characters-from-string/153547 "2018-10-23T08:35:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![singhster](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@singhster](https://discuss.elastic.co/u/singhster)\
**Post date:** [October 23, 2018, 8:35am UTC](https://discuss.elastic.co/t/json-input-get-right-characters-from-string/153547/1 "2018-10-23T08:35:29Z")

</div>

I'm using Kibana 6.4 and am trying to get the rightmost characters from a string using the JSON Input in a visualisation. I can successfully do this:

{"script":"\_value.substring(0,8)"}

But can't seem to find any documentation on the string functions available. Is there any documentation on what we can do with JSON Input?

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [October 24, 2018, 12:57pm UTC](https://discuss.elastic.co/t/json-input-get-right-characters-from-string/153547/2 "2018-10-24T12:57:11Z")

</div>

You shouldn't be using the JSON input for scripts. The best way to do it is by using the scripted fields option already available in Kibana. You get a detailed guide in that page and a way to test everything based on your data.

---

<div class="post-metadata">

**Author:** ![singhster](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@singhster](https://discuss.elastic.co/u/singhster)\
**Post date:** [October 25, 2018, 8:09am UTC](https://discuss.elastic.co/t/json-input-get-right-characters-from-string/153547/3 "2018-10-25T08:09:05Z")

</div>

Thanks Marius,

Is there any documentation to explain when we should be using JSON input? I'm struggling to understand how and when it should be used.

Thanks  
Simon

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [October 29, 2018, 12:02pm UTC](https://discuss.elastic.co/t/json-input-get-right-characters-from-string/153547/4 "2018-10-29T12:02:56Z")

</div>

It's usually for adding extra query parameters that aren't exposed in Kibana, for particular cases. It works for everything else, but scripted fields.

---

<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:** [November 26, 2018, 12:02pm UTC](https://discuss.elastic.co/t/json-input-get-right-characters-from-string/153547/5 "2018-11-26T12:02:57Z")

</div>

Closed on November 26, 2018, 12:02pm UTC

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