Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perform partial string match in ElasticSearch (Kibana)

I have the following property name in Kibana

{
    "source": {
        "type": "id",
        "id": "src_gn266o4vf5nevifl663fx3oggy"
    },
    "amount": 1234,
    "currency": "AED",
    "capture": true
}

How could I get all the results of type: id and id that starts with src_ ?

The following regex doesn't work:

{
  "query": {
    "match": {
      "e.Properties.RequestBody": {
        "query": "'source''type''id''id''src_*'",
        "type": "phrase"
      }
    }
  }
}
like image 495
Evangelos Gka Avatar asked Jan 17 '26 11:01

Evangelos Gka


1 Answers

You could use the wildcard query:

GET index_name/_search
{
  "query": {
    "wildcard": {
      "source.id": {
        "value": "src_*"
      }
    }
  }
{
like image 183
James Woodruff Avatar answered Jan 21 '26 07:01

James Woodruff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!