Splunk Search

X Axis (x-axis) don't show up in chart

Joshie
New Member

I have created a chart (Bar) with the following:

chart count(ProductName) over ProductCalss BY StoreZones

Therer were quite a numbner of rows, and there was no problem displat them.
However, the X-Axis do not show the ProductName at all. The Y-Label shows the count accurately.

What could have caused this?

Many thanks!

J

Tags (1)
0 Karma

lguinn2
Legend

You didn't ask for the ProductName to be displayed - you asked Splunk to count the number of events that contained a ProductName field. That's what count(ProductName) does. You asked to see this count displayed by ProductClass (I assume there was a typo in the name) and StoreZones.

If you just want a table, try this

yoursearchhere ProductName=*
| stats count by StoreZones ProductClass ProductName

If you really want a chart then go with

yoursearchhere ProductName=*
| chart count over StoreZones by ProductName

or some variant. Note that you can have as many break-out fields as you like in a stats command, but only two in a chart command. So you will have to pick two, or create a concatenated field, like this

yoursearchhere ProductName=*
| eval Product = ProductClass + ": " + ProductName
| chart count over StoreZones by Product
0 Karma

Joshie
New Member

Hi Iguinn, thanks for your response.
However, what makes me ask the question is if I restrict to a smaller group (resulting in a smaller "product" range, the label came back.

So I am more incline to the limitation of the charting function.

0 Karma

HattrickNZ
Motivator

chart count by sentMessage | or chart count by sentMessage | did not make any difference to the x-axis for me. in either case the x-axis had no labels. have I understood the question/answer correctly?? tks

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...