# How to extract part of a string from a field in json format and put it into a self added field?

**URL:** <https://discuss.elastic.co/t/how-to-extract-part-of-a-string-from-a-field-in-json-format-and-put-it-into-a-self-added-field/230532>\
**Category:** Logstash\
**Created:** [April 30, 2020, 11:52am UTC](https://discuss.elastic.co/t/how-to-extract-part-of-a-string-from-a-field-in-json-format-and-put-it-into-a-self-added-field/230532 "2020-04-30T11:52:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iammanmale](https://avatars.discourse-cdn.com/v4/letter/i/5e9695/32.png) [@iammanmale](https://discuss.elastic.co/u/iammanmale)\
**Post date:** [April 30, 2020, 11:52am UTC](https://discuss.elastic.co/t/how-to-extract-part-of-a-string-from-a-field-in-json-format-and-put-it-into-a-self-added-field/230532/1 "2020-04-30T11:52:14Z")

</div>

As the title, I successfully use json filter to extract the items from the data which is in json format, but i cannot extract part of a string from one of the field extracted and put it into another self added field.

I have been trying something like below

```auto
filter {
                grok {
                match => { "message" => "%{TIMESTAMP_ISO8601:timestamp}:json%{SPACE}:%{SPACE}%{GREEDYDATA:json_data}" }
                }
}

filter {
                json{
                        source => "json_data"
                        add_field => { "detailInstanceName" => "%{[json_data][ProcessPath]}" }
                }
}

```

the field of detailInstanceName can be show in kibana but its values is literally %{[json\_data][ProcessPath]}. I want to put the value of ProcessPath field extracted from json data into this detailInstanceName and then I can extract part of if into another field.

---

<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:** [May 28, 2020, 11:52am UTC](https://discuss.elastic.co/t/how-to-extract-part-of-a-string-from-a-field-in-json-format-and-put-it-into-a-self-added-field/230532/2 "2020-05-28T11:52:15Z")

</div>

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