# How to use json input field?

**URL:** <https://discuss.elastic.co/t/how-to-use-json-input-field/138304>\
**Category:** Kibana\
**Created:** [July 3, 2018, 4:54am UTC](https://discuss.elastic.co/t/how-to-use-json-input-field/138304 "2018-07-03T04:54:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sjaak01](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sjaak01](https://discuss.elastic.co/u/Sjaak01)\
**Post date:** [July 3, 2018, 4:54am UTC](https://discuss.elastic.co/t/how-to-use-json-input-field/138304/1 "2018-07-03T04:54:35Z")

</div>

Hi,

I got a metric with various SUM of bytes. Now I want to use the json input field to separate the SUM per subnet (e.g. 192._._._, 172._._._) .

However I have no clue how the json format is supposed to look. The documentation is no help at all.

How can I create a json search that searches for 192.168.0.\*?

edit: something like {"dst\_addr":"192.168.0.\*"} just results in errors.

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [July 3, 2018, 5:58pm UTC](https://discuss.elastic.co/t/how-to-use-json-input-field/138304/2 "2018-07-03T17:58:12Z")

</div>

I don't think you want to use the JSON input to do the separation. You probably want to use a "Split Group" bucket aggregation to define the groups/buckets that you want "sum of bytes" aggregation to be calculated in.

Since it seems you want to group by an IPv4 address I recommend using the "IPv4 Range" bucket aggregation and then define the address ranges that you want represented on the `dst_addr` field. If you're comfortable with CIDR masks, you can use those too.

My data is a little different from yours, so I used different ranges, but this is what I did to split the metric by IP range:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/a/aa71aeea976fdc87da47fa54919e98831ebd2bdb.png)

---

<div class="post-metadata">

**Author:** ![Sjaak01](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sjaak01](https://discuss.elastic.co/u/Sjaak01)\
**Post date:** [July 5, 2018, 1:31am UTC](https://discuss.elastic.co/t/how-to-use-json-input-field/138304/3 "2018-07-05T01:31:46Z")

</div>

Thanks. I don't have my fields configured for the IP type though. Can't remember why I didn't do that. The IP field type does support wildcard searches? Some of my dashboards rely on being able to do something like 192.168.0.\*.

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [July 5, 2018, 2:44am UTC](https://discuss.elastic.co/t/how-to-use-json-input-field/138304/4 "2018-07-05T02:44:00Z")

</div>

I’m not 100% sure you can use wildcards but you can use CIDR notation, so you could write `192.168.0.0/24` Which roughly translates to `192.168.0.*`

---

<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:** [August 2, 2018, 2:44am UTC](https://discuss.elastic.co/t/how-to-use-json-input-field/138304/5 "2018-08-02T02:44:02Z")

</div>

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