# How to solve spring metrics data (in json format ) in logstash

**URL:** https://discuss.elastic.co/t/how-to-solve-spring-metrics-data-in-json-format-in-logstash/162293
**Category:** Logstash
**Created:** [December 28, 2018, 3:02am UTC](https://discuss.elastic.co/t/how-to-solve-spring-metrics-data-in-json-format-in-logstash/162293 "2018-12-28T03:02:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![AndyLin](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@AndyLin](https://discuss.elastic.co/u/AndyLin)
#### Post date: [December 28, 2018, 3:02am UTC](https://discuss.elastic.co/t/how-to-solve-spring-metrics-data-in-json-format-in-logstash/162293/1 "2018-12-28T03:02:14Z")

</div>

I was new to ELKB stack.  
I use http beat to get the metrics data from my spring boot app, and send it to logstash for solving.  
But I can not find any helpful info to solve my json data to the data I want for sending to elastic search.  
Here is my metric data(after solved by logstash ):

```auto
    {
    "@timestamp" => 2018-12-28T02:23:01.003Z,
          "beat" => {
        "hostname" => "hostname",
            "name" => "name",
         "version" => "4.0.0"
    },
      "response" => {
           "headers" => {
                              "Date" => "Fri, 28 Dec 2018 02:23:01 GMT",
                            "Pragma" => "no-cache",
                   "X-Frame-Options" => "DENY",
                  "X-Xss-Protection" => "1; mode=block",
            "X-Content-Type-Options" => "nosniff",
                           "Expires" => "0",
                     "Cache-Control" => "no-cache, no-store, max-age=0, must-re
alidate",
               "Content-Disposition" => "inline;filename=f.txt",
                      "Content-Type" => "application/json;charset=UTF-8"
        },
        "statusCode" => 200,
          "jsonBody" => {
             "measurements" => [
                [0] {
                    "statistic" => "VALUE",
                        "value" => 32
                }
            ],
            "name" => "jvm.threads.live",
            "availableTags" => []
        }
    },
          "type" => "httpbeat",
      "@version" => "1",
          "host" => "hostname",
       "request" => {
        "headers" => {
            "Accept" => "application/json"
        },
         "method" => "get",
            "url" => "http://localhost:8080/actuator/metrics/jvm.threads.live"
    },
        "fields" => {
        "appid" => "appid"
    },
          "tags" => [
        [0] "beats_input_raw_event"
    ]
}

```

and my logstash config do nothig, the config is

```auto
input {
    beats {
        port => "5044"
    }
}
filter {
	json {
		source => "jsonBody"
		remove_field => ["headers"] #seems not work for remove the field
	}
}
output {
    stdout { codec => rubydebug }
}

```

and the data I want is,

```auto
 "jsonBody" => {
             "measurements" => [
                [0] {
                    "statistic" => "VALUE",
                        "value" => 32
                }
            ],
            "name" => "jvm.threads.live",
            "availableTags" => []
 }

```

and also the timestamp.

So can any one help. Any tutorial or logstash config is fine.  
Thanks.

---

<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: [January 25, 2019, 3:02am UTC](https://discuss.elastic.co/t/how-to-solve-spring-metrics-data-in-json-format-in-logstash/162293/2 "2019-01-25T03:02:17Z")

</div>

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