# How do I index regular expressions?

**URL:** <https://discuss.elastic.co/t/how-do-i-index-regular-expressions/117826>\
**Category:** Logstash\
**Created:** [January 31, 2018, 2:22pm UTC](https://discuss.elastic.co/t/how-do-i-index-regular-expressions/117826 "2018-01-31T14:22:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_Fox](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@Joshua\_Fox](https://discuss.elastic.co/u/Joshua_Fox)\
**Post date:** [January 31, 2018, 2:22pm UTC](https://discuss.elastic.co/t/how-do-i-index-regular-expressions/117826/1 "2018-01-31T14:22:49Z")

</div>

For log management, I want to build Kibana reports based on log lines like this:

```
2018-01-31 11:50:00.212 Loading the user images took 234 ms 
2018-01-31 10:23:01.984 Loading the user images took 331 ms 
2018-01-31 10:12:41.323 Loading the user images took 512 ms 

```

So, the report would take lines with the string `Loading the user images took`

Then the regex would extract the number as in `/took (\d+) ms/` and build a chart or notification.

How do I do this?

(Searching for this topic, I find discussion of [regex queries](https://discuss.elastic.co/t/kibana-how-to-regex-query-for-hostname/29317) and [indexes](https://discuss.elastic.co/t/kibana-regex-as-index-pattern/92696) but nothing about this functionality (which is quite basic in Splunk.)

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 31, 2018, 2:30pm UTC](https://discuss.elastic.co/t/how-do-i-index-regular-expressions/117826/2 "2018-01-31T14:30:21Z")

</div>

You can parse and extract values into separate fields in Logstash, e.g. using a [grok filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html). Then you can use these fields to build visualizations in Kibana.

---

<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:** [February 28, 2018, 2:30pm UTC](https://discuss.elastic.co/t/how-do-i-index-regular-expressions/117826/3 "2018-02-28T14:30:49Z")

</div>

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