# Search for a variable string in Kibana

**URL:** <https://discuss.elastic.co/t/search-for-a-variable-string-in-kibana/160576>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [December 12, 2018, 3:46pm UTC](https://discuss.elastic.co/t/search-for-a-variable-string-in-kibana/160576 "2018-12-12T15:46:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arnav\_Bose](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Arnav\_Bose](https://discuss.elastic.co/u/Arnav_Bose)\
**Post date:** [December 12, 2018, 3:46pm UTC](https://discuss.elastic.co/t/search-for-a-variable-string-in-kibana/160576/1 "2018-12-12T15:46:31Z")

</div>

I am new to Kibana. I have a log message coming and I want to extract some field and fire an alert:

{"msg":"Certificate is going to expire in 1088 Regenerate the same","date":1088}

I want to extract the date info to fire an alert if the date is less than 60 Is there any way this can be handled using some query in kibana?

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [December 12, 2018, 9:39pm UTC](https://discuss.elastic.co/t/search-for-a-variable-string-in-kibana/160576/2 "2018-12-12T21:39:38Z")

</div>

Am thinking that you would need to Use a Painless script as a watcher condition ([https://www.elastic.co/guide/en/elastic-stack-overview/6.5/condition-script.html](https://www.elastic.co/guide/en/elastic-stack-overview/6.5/condition-script.html)) to test your condition and trigger an alert. or even better to use a Painless script to [transform](https://www.elastic.co/guide/en/elastic-stack-overview/6.x/transform-script.html) watch data into a new payload for use in a response to a condition.

Cheers  
Rashmi

---

<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:** [January 9, 2019, 9:48pm UTC](https://discuss.elastic.co/t/search-for-a-variable-string-in-kibana/160576/3 "2019-01-09T21:48:11Z")

</div>

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