# Analysis to get key=value tokens

**URL:** <https://discuss.elastic.co/t/analysis-to-get-key-value-tokens/183153>\
**Category:** Elasticsearch\
**Created:** [May 28, 2019, 5:09pm UTC](https://discuss.elastic.co/t/analysis-to-get-key-value-tokens/183153 "2019-05-28T17:09:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![agosmaker](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@agosmaker](https://discuss.elastic.co/u/agosmaker)\
**Post date:** [May 28, 2019, 5:09pm UTC](https://discuss.elastic.co/t/analysis-to-get-key-value-tokens/183153/1 "2019-05-28T17:09:41Z")

</div>

Hello,

I can have message like this  
`Some object id=3 created by user=123`

What is the best way to get tokens

`id=3, user=123`

after analysis?

I think about splitting with standard delimiters (with Tokenizer) excluding "=" and filtering (with Token Filters) everything that doesn't contain it.

But maybe there is another better way.  
And if not, can I exclude everything that not contain "=" without regular expressions?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 29, 2019, 7:16am UTC](https://discuss.elastic.co/t/analysis-to-get-key-value-tokens/183153/2 "2019-05-29T07:16:01Z")

</div>

An alternative approach might be to split this data at indexing time in separate fields, so that you can actually query it as well as easily access it.

Take a look at the [node ingest feature](https://www.elastic.co/guide/en/elasticsearch/reference/7.1/ingest.html) and specificially the [grok processor](https://www.elastic.co/guide/en/elasticsearch/reference/7.1/grok-processor.html)

hope this helps!

---

<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:** [June 26, 2019, 7:16am UTC](https://discuss.elastic.co/t/analysis-to-get-key-value-tokens/183153/3 "2019-06-26T07:16:07Z")

</div>

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