# Scripted Field for elements inside JSON objects

**URL:** <https://discuss.elastic.co/t/scripted-field-for-elements-inside-json-objects/215224>\
**Category:** Elasticsearch\
**Created:** [January 15, 2020, 10:54pm UTC](https://discuss.elastic.co/t/scripted-field-for-elements-inside-json-objects/215224 "2020-01-15T22:54:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yishaihl](https://avatars.discourse-cdn.com/v4/letter/y/f19dbf/32.png) [@yishaihl](https://discuss.elastic.co/u/yishaihl)\
**Post date:** [January 15, 2020, 10:54pm UTC](https://discuss.elastic.co/t/scripted-field-for-elements-inside-json-objects/215224/1 "2020-01-15T22:54:39Z")

</div>

Hey Guys,  
I'm using FluentD (deployed as DaemonSet) to stream k8s app (containers) logs to elasticsearch. i want to extract specific keys from the 'log' key string (see attached) in elastic such as logKey: ... or statusCode:..  
i want to use scripted field ~ painless script.  
i struggled a bit with it, can someone please advise?

 ![Screen Shot 2020-01-16 at 0.50.44](https://us1.discourse-cdn.com/elastic/original/3X/8/4/84f8f49ae1ab6b2fbe6a972fbb291aad7bd010d0.png)

---

<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:** [February 12, 2020, 10:54pm UTC](https://discuss.elastic.co/t/scripted-field-for-elements-inside-json-objects/215224/2 "2020-02-12T22:54:48Z")

</div>

Closed on February 12, 2020, 10:54pm UTC

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