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
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...