I'm using ELK to pull machine logs and visualize them on a dashboard so we can display how our shop is doing on a large tv. One of the things that I want to display is the current event of a machine. For readability, I want to display a color on a square based off of the last value a field had. For example, if the field had reported "ACTIVE" I want to be able to display a green square.
There are six values for the event field, and it only exists in a record when it changes. I have four machines which I can identify off of their DeviceUUID, so I will need to filter out all but one machine for each instance. I also need for the square to update whenever Kibana refreshes.
I created the square in Vega, and I want to change the fill and stroke based off of the last value of the event field. I know I need to filter by both "if the event field exists" and "DeviceUUID". However, I haven't gotten the update working, so I'm left with an empty square.
I'm extremely new to Vega, so any help would be much obliged.
A bit more information, I've been trying to use "test" in order to change the fill color in the "update" encoding of my square. Before that, I tried to include the test immediately after the type declaration, as below. Above the mark is the standard Vega template.
That gets me halfway there, but the square isn't filled with a color after the changes. I think the problem may be the "test" keywords, and either the fact I have a chain of them to determine the fill color, or their placement in the code.
When I changed the test to an always true statement, the the square remained empty.
Time for a quick update. I've set up my logstash so that every log will report the last event which was reported for the machine it came from. This is stored as lastEvent. I did this because I've noticed names which include periods are harder to work with in ELK. Below is my Vega code. If I remove the fill block, then it shows the default green. If I include the condition block, then it returns an empty square which I believe is a NULL fill.
I found out the error, and it's in how I was using multiple "if" statements. As it turns out, Vega does not currently support more than one test statement in a condition block. This is why the statement below works, and not the examples above.
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.