Kibana: put if condition to graphs

Hi,
i have logs coming to Kibana looking like this:
runID: abc1
name: test1
result: pass
runID: abc1
name: test2
result: fail

So i have few tests under one run. I need to set a status of FAIL/PASS to each run as a whole. So if there is at least one result "fail" I need to set a whole run as FAIL. only if all the tests within one run are passed, then the result is supposed to be passed.
I cannot use just ordering by @timestamp as the last test is pass, but there is also a fail test in the test run.

Could you please help? Thanks a lot.

You can simply click "add filter" (top left of the interface) then select result as the field, select if conditional and fail as value.

Or type result:fail in the query bar. Both can be saved with a visualization.

That way your visualization will only show runID's that failed.

Thank you. But i never know the runID value. I can look it up in logs, but I need it to work automatically. i always need to display results for the last runID package, and need to filter just these tests. I dont know, in advance, how the runID string will look like. It is a "random" string of maybe 50 characters.
There are maybe 50 runs each day, and always need values for the last run only. And it must work automatically.

Or maybe I just did not understand you correctly

Hey @zuzka

Try filtering/creating a Max (last known) metric that allows to only see last data from a field

Thank you. My field is not available for "Max" metrics. It is a string and cannot be recognized via "Max".

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