Splunk Search

How to change the row colors based on the field value using CSS in splunk

disha
Contributor

I am getting the result data in the form of table from the view's SimpleResultsTable. In result data I have the fields Custid and EventId. For one CustomerID we can have more than one eventId.

CustID EventID

01 876

01 545

01 339

02 876

02 993

03 378

04 838

I want to make changes in $SPLUNK_HOME/etc/apps//appserver/static/my.css so that
1. Row color for each custid is different.
2. for each custid I want to make one row as

custid EventID

            876

01 545

339

           876

02 993

03 378

The problem is that I know CSS but I don't know how to access value of CustID from simpleResultsTable and how to set row color on the basis of CustID value and group them together.
I have tried to go thru documentation but I did not find the solution:( Please help me.

Tags (1)
0 Karma
1 Solution

disha
Contributor

I am able to figure it out.
tr:nth-child(even) {
color: #000000;
background-color: #FFDEAD;
}
tr:nth-child(odd) {
color : #000000;
background-color: #FFDEAD;
}
Put this code in $Splunk_Home/etc/apps/myapp/appserver/static/name.css

Also displaying the rows group togeher based on the field value, I achieved by Splunk search
as | stats list(eventid) by custid.

View solution in original post

0 Karma

disha
Contributor

I am able to figure it out.
tr:nth-child(even) {
color: #000000;
background-color: #FFDEAD;
}
tr:nth-child(odd) {
color : #000000;
background-color: #FFDEAD;
}
Put this code in $Splunk_Home/etc/apps/myapp/appserver/static/name.css

Also displaying the rows group togeher based on the field value, I achieved by Splunk search
as | stats list(eventid) by custid.

0 Karma

disha
Contributor

My editing for showing the table is corrupted but summary is that I want to group together in one row for each custid and need different color for each customer id.
Thanks

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Rounding off the Splunk Dashboard Contest

What does a contest-winning Splunk dashboard look like? In this case, it isn't in a browser tab at all. It ...