Splunk Search

Get multiple Fields in chart function

sumarri
Path Finder

So, I have a chart function that works perfectly!

| chart sum(transactionMade) over USERNUMBER by POSTDATE

But, I want my chart to have USERNUMBER and USERNAME. They are both correlated, so it should not be an issue. I also want to add Team Number, which there is no correlation to USERNUMBER and USERNAME.

Is it possible to have multiple fields after over?


I can concatenate all the fields into one string, but it would be easier if they were separate columns.

Thank you! 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Further to @gcusello 's response, the chart command has only three dimensions, the over field, the by field and the aggregation function. Although, strictly speaking, this can be extended by multiple aggregation functions, but you end up with composite column names.

As already suggested, concatenating fields is one way to get around this. Another way is perhaps more tricky and involves using the stats command instead and then messing around with the fields to get the by field values represented as field/column names.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @sumarri,

for my knowledge, the only way is concatenating the fields in one field and use it for the chart command.

Ciao.

Giuseppe

sumarri
Path Finder

Okay, that is what I thought. 

 

Thank you so much for conforming! 😊

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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