Filter to select lines that contain a certain word which begins with "ANS" and which can end with a series of numbers or letters

Hello everybody,

I would like to create a filter who select lines that contain a certain word which begins with "ANS" and which can end with a series of numbers or letters.

For example, I have a Tag who contains these lines :

ANS2832E Incremental by snapshot difference failed
BM Spectrum Protect Backup-Archive Client Version 8, Release 1, Level 4.0

i would like make a regex like this :

image

but it not work... Can you help me please ?
Thanks a lot ! :smiley:

Hi @boubou

I think you will need to do a regex query instead of match_phrase

Something like

POST test/_search
{
  "query": {
    "regexp": {
      "logMessage.keyword": {
        "value": "ANS.*"
      }
    }
  }
}
1 Like