# Search a string in Kibana

**URL:** <https://discuss.elastic.co/t/search-a-string-in-kibana/314468>\
**Category:** Kibana\
**Created:** [September 15, 2022, 3:19am UTC](https://discuss.elastic.co/t/search-a-string-in-kibana/314468 "2022-09-15T03:19:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sree3](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@sree3](https://discuss.elastic.co/u/sree3)\
**Post date:** [September 15, 2022, 3:19am UTC](https://discuss.elastic.co/t/search-a-string-in-kibana/314468/1 "2022-09-15T03:19:23Z")

</div>

Hi,  
We could see below custom message from one of the indices. I'm trying to filter a string "heap.memory.used/total=7" so that an action can triggered if the used heap memory used greater than 9\*%. Every time if is try search for “heap.memory.used/total=7\*” i am unable to get any data.

Could someone please help how i could filter out messages in Kibana UI that got "heap.memory.used/total=7\*"

"message": "2022-09-15 03:12:09,444 INFO processors=4, physical.memory.total=22.0G, physical.memory.free=9.0G, swap.space.total=0, swap.space.free=0, heap.memory.used=8.6G, heap.memory.free=3.0G, heap.memory.total=11.6G, heap.memory.max=11.6G, **heap.memory.used/total=73.91%** , heap.memory.used/max=73.91%, minor.gc.count=336, minor.gc.time=58697ms, major.gc.count=32, major.gc.time=246809ms, load.process=0.45%, load.system=0.60%, load.systemAverage=1.56,  
},

---

<div class="post-metadata">

**Author:** ![sree3](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@sree3](https://discuss.elastic.co/u/sree3)\
**Post date:** [September 15, 2022, 7:33am UTC](https://discuss.elastic.co/t/search-a-string-in-kibana/314468/2 "2022-09-15T07:33:29Z")

</div>

```auto
{
  "trigger": {
    "schedule": {
      "interval": "2m"
    }
  },
  "input": {
    "search": {
      "request": {
        "search_type": "query_then_fetch",
        "indices": [
          "applications-*"
        ],
        "rest_total_hits_as_int": true,
        "body": {
          "size": 1,
          "query": {
            "bool": {
              "must": [
                {
                  "match": {
                    "message": {
                      "query": "heap.memory.used/total=9*.**%",
                      "operator": "and"
                    }
                  }
                },
                {
                  "range": {
                    "@timestamp": {
                      "gte": "now-30m"
                    }
                  }
                }
              ]
            }
          },
          "_source": [
            "message",
            "beat.name"
          ]
        }
      }
    }
  },
  "condition": {
    "compare": {
      "ctx.payload.hits.total": {
        "gt": 0
      }
    }
  },
  "actions": {
    "email_me": {
      "email": {
        "profile": "standard",
        "priority": "high",
        "to": [
          "test@abc.com"
        ],
        "subject": " [Heap Memory]",
        "body": {
          "text": "Message = {{ctx.payload.hits.hits.0._source.message}}"
        }
      }
    }
  },
  "metadata": {
    "color": "red"
  },
  "throttle_period_in_millis": 900000
}

```

I'm trying at alert if memory usage is greater than 90% but above watcher is not working if i used "query": "heap.memory.used/total=9\*.\*\*%"

Could someone please help  
Thanks

---

<div class="post-metadata">

**Author:** ![sree3](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@sree3](https://discuss.elastic.co/u/sree3)\
**Post date:** [September 15, 2022, 11:01am UTC](https://discuss.elastic.co/t/search-a-string-in-kibana/314468/3 "2022-09-15T11:01:34Z")

</div>

In Kibana URL, i could able to get the expected results by using the below command

`"heap.memory.used/total" and message : 9*`

Someone please help me how i can add above search term in watcher alert

---

<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:** [October 13, 2022, 11:02am UTC](https://discuss.elastic.co/t/search-a-string-in-kibana/314468/4 "2022-10-13T11:02:13Z")

</div>

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