Hi,
i have a single value module which returns either a yes or a no, how to change their color to green if the result is NO and red if it is YES. i am working in simple xml. i tried changing the application.css with
..singleResult .YES{
color: #FF0000;
}
plese help
Thank you
Lets say your search outputs a field called 'yes_or_no' that contains 'YES' or 'NO' (probably using rangemap)
Your dashboard would look like :
<?xml version='1.0' encoding='utf-8'?>
<dashboard>
<label>Example</label>
<row>
<single>
<searchTemplate>... | table yes_or_no</searchTemplate>
<title>YES or NO</title>
<option name="classField">yes_or_no</option>
</single>
</row>
</dashboard>
Its the classField parameter that determines what css class it'll pick up
And your application.css would look like :
.SingleValue .NO .singleResult {
color: #ffb800;
}
.SingleValue .YES .singleResult {
color: #ffb800;
}
You need to restart splunk if application.css has just been created for the 1st time.
Lets say your search outputs a field called 'yes_or_no' that contains 'YES' or 'NO' (probably using rangemap)
Your dashboard would look like :
<?xml version='1.0' encoding='utf-8'?>
<dashboard>
<label>Example</label>
<row>
<single>
<searchTemplate>... | table yes_or_no</searchTemplate>
<title>YES or NO</title>
<option name="classField">yes_or_no</option>
</single>
</row>
</dashboard>
Its the classField parameter that determines what css class it'll pick up
And your application.css would look like :
.SingleValue .NO .singleResult {
color: #ffb800;
}
.SingleValue .YES .singleResult {
color: #ffb800;
}
You need to restart splunk if application.css has just been created for the 1st time.
thanks for this, I was just wondering yesterday how to do this and now it is done. splunk-base - what great source!
Thank youu
In that case classField should be x.
class field is the field in the search that sets the class.
yes_or_no isn't a field in your search
i am using a form with a dropdown box and my single value panel is like
|
index=main source=$sources$ |eval x=if(severity="FATAL","YES","NO") | sort - x |table x |head 1
FATAL :
yes_or_no
changed application.css with above code. still the single result is in black in color.