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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...