# Elastic Agent - Parsing JSON file to fields

**URL:** <https://discuss.elastic.co/t/elastic-agent-parsing-json-file-to-fields/360319>\
**Category:** Elastic Agent\
**Created:** [May 27, 2024, 9:10pm UTC](https://discuss.elastic.co/t/elastic-agent-parsing-json-file-to-fields/360319 "2024-05-27T21:10:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![idan\_amar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idan_amar/32/131806_2.png) [@idan\_amar](https://discuss.elastic.co/u/idan_amar)\
**Post date:** [May 27, 2024, 9:10pm UTC](https://discuss.elastic.co/t/elastic-agent-parsing-json-file-to-fields/360319/1 "2024-05-27T21:10:27Z")

</div>

hello i use the custom logs for input mtr.json file

```auto
{
    "report": {
        "mtr": {
            "src": "something.com",
            "dst": "something.else",
            "tos": 0,
            "tests": 10,
            "psize": "64",
            "bitpattern": "0x00"
        },
        "hubs": [
            {
                "count": 1,
                "host": "192.18.2.19",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 0.184,
                "Avg": 0.218,
                "Best": 0.173,
                "Wrst": 0.247,
                "StDev": 0.023
            },
            {
                "count": 2,
                "host": "199.4.48.1",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 0.38,
                "Avg": 0.372,
                "Best": 0.278,
                "Wrst": 0.449,
                "StDev": 0.046
            },
            {
                "count": 3,
                "host": "38.2.24.9",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 0.819,
                "Avg": 1.053,
                "Best": 0.819,
                "Wrst": 1.923,
                "StDev": 0.348
            },
            {
                "count": 4,
                "host": "14.24.3.11",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 0.869,
                "Avg": 1.04,
                "Best": 0.869,
                "Wrst": 1.138,
                "StDev": 0.087
            },
            {
                "count": 5,
                "host": "54.4.41.113",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 1.677,
                "Avg": 2.014,
                "Best": 1.669,
                "Wrst": 3.472,
                "StDev": 0.555
            },
            {
                "count": 6,
                "host": "14.5.4.86",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 69.771,
                "Avg": 79.623,
                "Best": 69.656,
                "Wrst": 104.19,
                "StDev": 15.887
            },
            {
                "count": 7,
                "host": "10.17.48.206",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 67.818,
                "Avg": 67.888,
                "Best": 67.702,
                "Wrst": 68.107,
                "StDev": 0.111
            },
            {
                "count": 8,
                "host": "149.4.81.106",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 69.569,
                "Avg": 69.587,
                "Best": 69.514,
                "Wrst": 69.745,
                "StDev": 0.075
            },
            {
                "count": 9,
                "host": "???",
                "Loss%": 100.0,
                "Snt": 10,
                "Last": 0.0,
                "Avg": 0.0,
                "Best": 0.0,
                "Wrst": 0.0,
                "StDev": 0.0
            }
        ]
    }
}

```

what should the custom logs settings be in order to parse each JSON object in this file as a field? like "host", "Wrst" and such should be fields.

thank you!

---

<div class="post-metadata">

**Author:** ![idan\_amar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idan_amar/32/131806_2.png) [@idan\_amar](https://discuss.elastic.co/u/idan_amar)\
**Post date:** [June 8, 2024, 2:20pm UTC](https://discuss.elastic.co/t/elastic-agent-parsing-json-file-to-fields/360319/2 "2024-06-08T14:20:13Z")

</div>

bump
