I have an alert where I am sending certain data from log in alert which is working as expected. What I want to do is, I also want to include URL in alert but not sure about one particular id.
i.e. http://MY-URL.com/_plugin/kibana/app/kibana#/doc/SOME-GUID/app-metrics-2020.02.06/_doc?id=DOC-ID&_g=()
Here is my way to create URL, http://MY-URL.com/_plugin/kibana/app/kibana#/doc/NOT-SURE-WHERE-TO-GET-THIS/{{ ctx.results.0.hits.hits.0._index }}/_doc?id={{ ctx.results.0.hits.hits.0._id }}
Is there a way I can get NOT-SURE-WHERE-TO-GET-THIS from ctx?
Unfortunately it won't be available in ctx. It's the index pattern id saved in the .kibana index. It is fixed to the kibana index pattern that's being searched over, so if the alert is fixed to a known index pattern you could grab that id. You can see it in the URL in the discover page.
A hacky workaround that may or may not have performance impacts is to create an index pattern in kibana that matches all indices (*) and use that id.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.