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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...