Hello,
I want to compare my desired monitor inputs to my actual monitor inputs. I am using btool in a script to gather my desired inputs from my forwarders. They look like this:
I want to create a dashboard panel which looks similar to this:
These are my desired inputs. Now I want my sources to be displayed with green font if there are events in the listed index with the listed host and the listed source. Otherwise, they should be displayed with red font. For example if the search query index=_internal host=uf1 source=/opt/splunkforwarder/var/log/splunk in the last hour retrieves at least 1 event, I want '/opt/splunkforwarder/var/log/splunk' to be displayed with green font.
So I have 3 problems. First, I need to know how to run a search for every single entry source in a dashboard.
Second, I need to know how to change font color in a dashboard.
Third, I need to know how to relate the search result to the color.
What I tried so far:
The search for my dashboard panel is
index=inputmonitor
| stats values(inputsource) as source by host, dest_index
| rename dest_index as index
I can not do something like
index=inputmonitor
| stats values(inputsource) as source by host, dest_index
| search index=_dest_index ...
Because the search command will only search my table and will not be able to search an index that is not inputmonitor.
So I really need a new search for every single combination of host, index, and source. Which means I need some kind of loop.
I suppose this is only possible with XML or probably even only with HTML and javascript. I do not have much experience with XML, HTML and javascript. I hope you know how to solve my problem or you have an idea how to solve this at least.
Here is my dashboard:
<dashboard>
<label>Forwarder Monitoring Clone</label>
<row>
<panel>
<title>input sources by host, index</title>
<table>
<search>
<query>index=inputmonitor | stats values(inputsource) as source by host, dest_index | rename dest_index as index</query>
<earliest>-10m</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">20</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">cell</option>
<option name="percentagesRow">false</option>
<option name="refresh.display">progressbar</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
<drilldown>
<link target="_blank">search?q=index=$row.index$%20host=$row.host$%20$click.name2$=$click.value2$&earliest=-60m@m&latest=now</link>
</drilldown>
</table>
</panel>
</row>
</dashboard>
Thank you in advance!
... View more