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!

Uncovering Multi-Account Fraud with Splunk Banking Analytics

Last month, I met with a Senior Fraud Analyst at a nationally recognized bank to discuss their recent success ...

Secure Your Future: A Deep Dive into the Compliance and Security Enhancements for the ...

What has been announced?  In the blog, “Preparing your Splunk Environment for OpensSSL3,”we announced the ...

New This Month in Splunk Observability Cloud - Synthetic Monitoring updates, UI ...

This month, we’re delivering several platform, infrastructure, application and digital experience monitoring ...