Dashboards & Visualizations

Charting fields code for the dashboard

AL3Z
Builder

Hi,

How we can apply the color for the respective fields in this dashboard.
source code :
<title>Top Web Category blocked</title>
<search>
<query>index=es_web action=blocked host= * sourcetype= *
| stats count by category
| sort 5 -count</query>
<earliest>$time_range_token.earliest$</earliest>
<latest>$time_range_token.latest$</latest>
</search>
<option name="charting.axisTitleX.visibility">visible</option>
<option name="charting.axisTitleY.visibility">visible</option>
<option name="charting.axisTitleY2.visibility">visible</option>
<option name="charting.chart">bar</option>
<option name="charting.backgroundColor">#00FFFF</option>
<option name="charting.fontColor">#000000</option>
<option name="charting.foregroundColor">#000000</option>
<option name="charting.chart.stackMode">default</option>
<option name="charting.drilldown">none</option>
<option name="charting.fieldColors">{"online-storage-and-backup":0x333333,"unknown":0xd93f3c,"streaming-media":0xf58f39,"internet-communications-and-telephony":0xf7bc38,"insufficient-content":0xeeeeee}</option>
<option name="charting.legend.placement">right</option>
<option name="refresh.display">progressbar</option>
</chart>
</panel>
</row>
</form>


output:

AL3Z_0-1698301208133.png


need a different  colors for all the fields, how we can achieve this 
thanks

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

In order to be able to colour them differently, you need separate fields. Try adding this to the end of your search

| transpose 0 header_field=category
0 Karma

AL3Z
Builder

Thanks, Can you be more precise where do we need to paste this in the xml source code of dashboard.

Thanks

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

At the end of the search query, i.e. after the sort command

AL3Z
Builder

Hi @ITWhisperer ,

How to make the fields to get displayed instead of row1,row2.....

AL3Z_2-1698334474804.png

Thanks..

0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with Brett Adams

In our third Spotlight feature, we're excited to shine a light on Brett—a Splunk consultant, innovative ...

Index This | What can you do to make 55,555 equal 500?

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

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...