# Filter on specific field

**URL:** <https://discuss.elastic.co/t/filter-on-specific-field/253731>\
**Category:** Kibana\
**Created:** [October 29, 2020, 4:35pm UTC](https://discuss.elastic.co/t/filter-on-specific-field/253731 "2020-10-29T16:35:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Sieger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomas_sieger/32/56310_2.png) [@Thomas\_Sieger](https://discuss.elastic.co/u/Thomas_Sieger)\
**Post date:** [October 29, 2020, 4:35pm UTC](https://discuss.elastic.co/t/filter-on-specific-field/253731/1 "2020-10-29T16:35:32Z")

</div>

Hello guys,

above my log message.

`user <TEST> from client <xyz (connection-xyz.de)>`

I want to filter on the content in the brackets \<\>, but I don´t only want to test how many hits this delivers. I also want to know how often the users are different, so how often the value in \<\> is not equal. I cant find the rigth query for this.

Pls help me guys and pls dont recommend the possibility with the security activities.

Thank you

---

<div class="post-metadata">

**Author:** ![dosant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dosant/32/64489_2.png) [@dosant](https://discuss.elastic.co/u/dosant)\
**Post date:** [October 30, 2020, 12:31pm UTC](https://discuss.elastic.co/t/filter-on-specific-field/253731/2 "2020-10-30T12:31:16Z")

</div>

Hi @Thomas_Sieger,

I'd suggest first to inject you data differently.  
It would be easier to analyse your data if you'd have a separate fields in you documents:

```auto
{
 message: "user <TEST> from client <xyz (connection-xyz.de)>",
 user: "<TEST>",
 client: "<xyz (connection-xyz.de)>"
}

```

If it is not possible to add these fields during ingestion, then you could try to extract them using [scripted fields](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html)

Then you could easily filter by `client` field and see number of hits.

> I also want to know how often the users are different, so how often the value in \<\> is not equal.

For this you could, for example, build a bar chart where on x axis are users (`user`) and y axis "uniq count" of clients (`client`).

---

<div class="post-metadata">

**Author:** ![Thomas\_Sieger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomas_sieger/32/56310_2.png) [@Thomas\_Sieger](https://discuss.elastic.co/u/Thomas_Sieger)\
**Post date:** [November 2, 2020, 8:57pm UTC](https://discuss.elastic.co/t/filter-on-specific-field/253731/3 "2020-11-02T20:57:04Z")

</div>

Hey dosant,

I dont really understand your expression:

> {  
> message: "user from client \<xyz ([connection-xyz.de](http://connection-xyz.de))\>",  
> user: "",  
> client: "\<xyz ([connection-xyz.de](http://connection-xyz.de))\>"  
> }

How can I structure this. I only read out my logfiles with filebeat and send them to Kibana. So can u describe where I can structure this?

Im new with Kibana ;(

Thank you in advance 😃

---

<div class="post-metadata">

**Author:** ![dosant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dosant/32/64489_2.png) [@dosant](https://discuss.elastic.co/u/dosant)\
**Post date:** [November 5, 2020, 9:30am UTC](https://discuss.elastic.co/t/filter-on-specific-field/253731/4 "2020-11-05T09:30:27Z")

</div>

You can pre-process documents before indexing using ingest node: [https://www.elastic.co/guide/en/beats/filebeat/current/configuring-ingest-node.html](https://www.elastic.co/guide/en/beats/filebeat/current/configuring-ingest-node.html)

To extract fields from the log message you can use [grok processor](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/grok-processor.html)

---

<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:** [December 3, 2020, 9:30am UTC](https://discuss.elastic.co/t/filter-on-specific-field/253731/5 "2020-12-03T09:30:39Z")

</div>

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