Dashboards & Visualizations

color a column based on its content using xml code

ramyaashok
New Member

i have a column status, which will have a message saying "successful" or "unsuccessful",
i want to color the cell green that has successful message
else if unsuccessful color it red.

please help me with the code

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@ramyaashok

    <dashboard>
      <label>Color Cell</label>
      <row>
        <panel>
          <table>
            <search>
              <query>| makeresults | eval status="successful,unsuccessful",status=split(status,",")| mvexpand status</query>
              <earliest>-24h@h</earliest>
              <latest>now</latest>
            </search>
            <option name="drilldown">none</option>
            <format type="color" field="status">
              <colorPalette type="map">{"successful":#00FF00,"unsuccessful":#FF0000}</colorPalette>
            </format>
          </table>
    </panel>
  </row>
</dashboard>

Refer: https://docs.splunk.com/Documentation/Splunk/7.3.1/Viz/TableFormatsXML#Table_format_source_code_exam...

0 Karma
Get Updates on the Splunk Community!

How to Monitor Google Kubernetes Engine (GKE)

We’ve looked at how to integrate Kubernetes environments with Splunk Observability Cloud, but what about ...

Index This | How can you make 45 using only 4?

October 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Splunk Education Goes to Washington | Splunk GovSummit 2024

If you’re in the Washington, D.C. area, this is your opportunity to take your career and Splunk skills to the ...