# Slashes in a JSON field - can't visualize on sub-fields

**URL:** <https://discuss.elastic.co/t/slashes-in-a-json-field-cant-visualize-on-sub-fields/144893>\
**Category:** Kibana\
**Created:** [August 17, 2018, 11:59am UTC](https://discuss.elastic.co/t/slashes-in-a-json-field-cant-visualize-on-sub-fields/144893 "2018-08-17T11:59:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patryk\_Miszczak](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Patryk\_Miszczak](https://discuss.elastic.co/u/Patryk_Miszczak)\
**Post date:** [August 17, 2018, 11:59am UTC](https://discuss.elastic.co/t/slashes-in-a-json-field-cant-visualize-on-sub-fields/144893/1 "2018-08-17T11:59:37Z")

</div>

Hello, I have been using Kibana for a couple days for now and i've ran into an issue with handling a JSON field that gets interptreted as a string somehow. Here is a peek into usual logs:

 ![firefox_2018-08-17_13-50-18](https://us1.discourse-cdn.com/elastic/original/3X/a/2/a2939fa231a4bfb231826246caf7eff466f6c4ac.png)

The log field should work as a JSON-field, but when you look ath the raw data it is littered with backslashes from previous sources:

 ![firefox_2018-08-17_13-52-39](https://us1.discourse-cdn.com/elastic/original/3X/f/9/f9d05d022fecb419bf205ad262533484ccd33d8d.png)

I can't visualize on any of the sub-fields nor process it any further.

What should i do about it ? Is it possible to solve it using pure Kibana features ? Do i need to install a plugin or tamper with whole efk stack ? Or should I rather fix the data at its source (this solution isn't preferrable due to security issues) ?

---

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [August 17, 2018, 12:23pm UTC](https://discuss.elastic.co/t/slashes-in-a-json-field-cant-visualize-on-sub-fields/144893/2 "2018-08-17T12:23:30Z")

</div>

Hi @Patryk_Miszczak,

As suggested [here](https://discuss.elastic.co/t/painless-scripting-json-functions/98511/2?u=azasypkin), you'd better properly re-ingest your data so that `log` field is indexed as an object, not as a string.

If it's something out of your control and you need to extract just some fraction of the data from `log` field you can create a scripted field and use [Painless API](https://www.elastic.co/guide/en/elasticsearch/painless/6.3/painless-api-reference.html) to extract the data you need. Painless doesn't support any specific JSON functionality, but you can use `String` functions like `indexOf` and `substring` to extract pieces you're interested in.

Thanks,  
Oleg

---

<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 14, 2018, 12:23pm UTC](https://discuss.elastic.co/t/slashes-in-a-json-field-cant-visualize-on-sub-fields/144893/3 "2018-09-14T12:23:38Z")

</div>

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