Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a Kibana URL from elasticsearch query

I want to generate an automatic kibana URL according to changing hostnames for the last 15 minutes. This is the elasticsearch query i'm using:

{'query': {'bool': {'minimum_should_match': 1, 'should': [{'match': {'beat.hostname.raw': 'xxxxxxx'}}, {'match': {'beat.hostname.raw': 'yyyyyyy'}}], 'must': [{'range': {'@timestamp': {'gte': 'now-15m'}}}]}}}

How can I create a parseable URL for kibana for this search?

Thanks,

like image 671
deez Avatar asked Mar 18 '18 09:03

deez


1 Answers

Posting the answer for this in case anyone will come across this:

https://kibanaurl.com/app/kibana#/discover?_g=(time:(from:now-15m,mode:quick,to:now))&_a=(columns:!(_source),filters:!((bool:(should:!((term:(beat.hostname.raw:xxxxxx)),(term:(beat.hostname.raw:yyyyyyy)))))),index:IndexName)
like image 119
deez Avatar answered Oct 23 '22 13:10

deez