In canvas markdown. I am using elastic sql to pull data from metric beat and sorting it to latest document as I wanted to see the latest result of the jenkins job. SELECT http.json_test.building,http.json_test.url,http.json_test.result FROM "metricbeat-*" ORDER BY "@timestamp" DESC LIMIT 1
@lukeelmers Thank you for your reply. Single quotes or backslash did not work but adding an alias names worked .
Can I use the same settings in visual builder markdown. Will this work?
Since I am having result column(Success/failed) . I want to change the color for markdown to "Red " when it is failed and green when successful . Any idea how I can achieve it.
Can I use the same settings in visual builder markdown. Will this work?
Yes, visual builder supports handlebar templates in markdown, however, it does not use the same querying infrastructure that Canvas uses (so you won't be able to use the same Canvas expression with SQL to get your data).
If you are able to get the results you are looking for by configuring visual builder, then it should be possible to access the values from within the markdown. The data is just structured a bit differently.
Since I am having result column(Success/failed) . I want to change the color for markdown to "Red " when it is failed and green when successful . Any idea how I can achieve it.
I don't think this exactly helps in your situation, but generally you can do this by editing the expression directly and using the if statement inside of the font argument:
However, I don't think you can specify multiple color values within a single markdown element -- so if you were wanting to color each item in your list differently, I don't think that will work here.
In my example above I am using getCell to pull from row 0 of the http.json_test.result column -- so as you can see, you're limited on setting a single color.
@lukeelmers I want to change the color of entire markdown widget, So I can show it as a status indicator. It will look like this.
One more last question. Is it possible to change the shape of markdown widget. In which case I can create multiple markdowns and added them side by side to show a pipeline.
You can't change the shape of the markdown widget, but you could use a separate shape element and conditionally color it. The implementation of this would involve a similar technique to what I described above, only applied to the shape function instead.
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.