# Regexp on Standard Analyzer Field

**URL:** https://discuss.elastic.co/t/regexp-on-standard-analyzer-field/95176
**Category:** Elasticsearch
**Created:** [July 31, 2017, 11:29am UTC](https://discuss.elastic.co/t/regexp-on-standard-analyzer-field/95176 "2017-07-31T11:29:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mbrosnan](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mbrosnan](https://discuss.elastic.co/u/mbrosnan)
#### Post date: [July 31, 2017, 11:29am UTC](https://discuss.elastic.co/t/regexp-on-standard-analyzer-field/95176/1 "2017-07-31T11:29:16Z")

</div>

Hi, new to Elasticsearch,

is there any way to do a regex search on a field mapped by a _standard analyzer_.

```
 "message" : {
            "type" : "string",
            "analyzer" : "standard"
}

```

This is a graylog index so I cannot change the analyzer.  
Can I change the analyzer in the search query somehow?

Here is a full-text response when just querying ossec with match or match\_phrase:

`"hosts1 ossec: Alert Level: 5; Rule: 31101 - Web server 400 error code"`

I want my query response to show messages with any hostname, and any alert level from 5-9. .. so something like the below.

```
curl -XPOST 'localhost:9200/graylog_0/_search?pretty' -d '
{"query":
  {"regexp": {"message": {
            "value": ".*ossec: Alert Level: [5-9]"
                        }
            }
  }
}'

```

Thank you.

---

<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 28, 2017, 11:29am UTC](https://discuss.elastic.co/t/regexp-on-standard-analyzer-field/95176/2 "2017-08-28T11:29:23Z")

</div>

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