Splunk Search

Non-numerical values in a table

NancyCunningham
Engager

Trying to put together a table that compares service versions across environments.

Able to get a list using stats

 stats first(version) by service, environment

Would like to have this same info organized as a table, tried

 chart first(version) by service, environment

but this doesn't return service versions like 1.2.31

Seems that chart only works with numbers - figure there must be some other way to build a table.

Thanks, Nancy

Tags (2)

vbumgarn
Path Finder

I don't think this is what it was designed for, but it turns out maketable does exactly what is needed.

search... | stats first(version) as version by environment service | maketable service environment version

gkanapathy
Splunk Employee
Splunk Employee

actually that is exactly what xyseries was intended for

0 Karma

Johnvey
Contributor

'maketable' is also known as 'xyseries'.

0 Karma

sideview
SplunkTrust
SplunkTrust

That's right, timechart and chart do their best to only return numeric data, so first() and values() wont work as you might expect for non-numeric fields.

for more on that topic, see this related question: http://answers.splunk.com/questions/2295/how-come-some-fields-disappear-when-they-go-into-timechart-...

So, you cant use chart, you have to use stats. And the xyseries command can convert the "stats output format", where each row is a unique combination, to what you might call the "chart output format" that's the 2-dimensional table that you want.

stats first(version) by service, environment | xyseries service, environment, first(version)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...