Splunk Search

custom X-axis value

SanthoshSreshta
Contributor

Hi. My aim is to get custom text in X-axis instead of actual values.

I have used a query to generate column chart
sourcetype="Customer_Churn"
| eval CHURN = if(CHURN="1",1,0)
| stats sum(CHURN) as total_churn by PLACEMENT

the values of PLACEMENT are 0 and 1 which indicated Rural and Urban respectively.
alt textI need Rural and Urban instead of 0 and 1 on the X-axis. Is it possible with splunk.??

Thanks in advance.
Santhosh

0 Karma
1 Solution

stephanefotso
Motivator

Try this:

sourcetype="Customer_Churn"
| eval CHURN = if(CHURN="1",1,0)
| stats sum(CHURN) as total_churn by PLACEMENT| replace 0 with "Rural" in PLACEMENT | replace 1 with "Urban" in PLACEMENT

SGF

View solution in original post

0 Karma

stephanefotso
Motivator

Try this:

sourcetype="Customer_Churn"
| eval CHURN = if(CHURN="1",1,0)
| stats sum(CHURN) as total_churn by PLACEMENT| replace 0 with "Rural" in PLACEMENT | replace 1 with "Urban" in PLACEMENT

SGF
0 Karma

SanthoshSreshta
Contributor

Thank you for the quick response.
Doesn't they be placed right middle of it. like as i showed in the above image

0 Karma

stephanefotso
Motivator

Hi! Is there any problem with the query ? I think the question was accepted. What happen again? OK Concerning the configuration of your chart, check here,
http://docs.splunk.com/Documentation/Splunk/latest/Viz/ChartConfigurationReference

I Think it may help
Thanks!

SGF
0 Karma

SanthoshSreshta
Contributor

Hi @stephanefotso I have used
<option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
but there is no change in it. Is that the tag I should use to get or there is any other tag.?
I am unaware of this. please help me

0 Karma

Arun_N_007
Communicator

Hi Santhosh,

I dont think it is possible with Splunk default chart (JS Chart). If you want to change you might need to play with the CSS part of it or you can implement D3 Bar chart in Simple XML.

SanthoshSreshta
Contributor

okay fine. can we do for each map or the same CSS will effect all charts and maps.?

0 Karma

stephanefotso
Motivator

each map, his own css file

SGF
0 Karma

SanthoshSreshta
Contributor

Can you please share me, How to add CSS files and HTML files, I am reading many post. lot many people are doing lot many things from HTML and CSS. I didn't get anywhere ; how to add such things.?

here is my post link
link for the post

0 Karma

stephanefotso
Motivator

I don't know, but i think it is possible.
Thanks!

SGF
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!

Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas

    Thursday, June 25, 2026  |  11AM PDT / 2PM EDT  Duration: 1 Hour (Includes live Q&A) Register to ...

Analytics Workspace deprecation

As of Splunk Cloud Platform 10.4.2604 and Splunk Enterprise 10.4, Analytics Workspace is now deprecated. ...

Splunk Developer Day Recap: Building, Publishing, and Growing on the Splunk Platform

Splunk Developer Day brought the Splunk developer community together for a practical look at what it means to ...