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!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...