# How to assign the json values to fields

**URL:** <https://discuss.elastic.co/t/how-to-assign-the-json-values-to-fields/154418>\
**Category:** Logstash\
**Created:** [October 29, 2018, 10:01am UTC](https://discuss.elastic.co/t/how-to-assign-the-json-values-to-fields/154418 "2018-10-29T10:01:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manoj\_gundam](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@manoj\_gundam](https://discuss.elastic.co/u/manoj_gundam)\
**Post date:** [October 29, 2018, 10:01am UTC](https://discuss.elastic.co/t/how-to-assign-the-json-values-to-fields/154418/1 "2018-10-29T10:01:07Z")

</div>

hi my log message looks like this

{"applicationName":test, "FlowName":test, "key":"EmpID", "Value":"E103", "Domain": 0,"hostname":localhost,"cluster":, "LogStatus":"InProcess", "CurrentPayload":"E103", "FlowID":null, "LogMessage":"Retrieving User Details" }

I am trying to extract all the details of the values and assign them to fields

Desired output example :- applicationName(Field) : test

my config file looks like this

input {  
stomp {  
host =\> "10.0.0.235"  
destination =\> "test"  
}  
}

filter {  
json{  
source =\> "message"  
}

```
split {
    field => "message"
}

     mutate {
            add_field => {
                    "applicationName" => "%{[message][applicationName]}"
                    "FlowName" => "%{[message][FlowName]}"
                    "key" => "%{[message][key]}"
                    "Value" => "%{[message][Value]}"
                    "Domain" => "%{[message][Domain]}"
                    "hostname" => "%{[message][hostname]}"
                    "cluster" => "%{[message][cluster]}"
                    "LogStatus" => "%{[message][LogStatus]}"
                    "CurrentPayload" => "%{[message][CurrentPayload]}"
                    "FlowID" => "%{[message][FlowID]}"
                    "LogMessage" => "%{[message][LogMessage]}"

```

}

remove\_field =\> ["[message]" ]  
}  
output {  
elasticsearch { hosts =\> ["localhost:9200"]  
hosts =\> "localhost:9200"  
manage\_template =\> false  
index =\> "activemq-%{+YYYY.MM.dd}"  
document\_type =\> "%{[@metadata][type]}"  
}  
}

appreciate any help I can get on this. thankyou

---

<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, 10:01am UTC](https://discuss.elastic.co/t/how-to-assign-the-json-values-to-fields/154418/2 "2018-11-26T10:01:07Z")

</div>

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