Splunk Search

how to show multiple columns in table along with timestamp

rkishoreqa
Communicator

Hi team,

 

I have one requirement to prepare a query to get a value from json and do chart count around it. For this I have added multiple chart count queries using appendcols, but it is very slow.  Also I need the timestamp. 

log is like as below: 

Success: 1
failed: 2
Total: 3

index=<<>> |search app="app1" |rex "Total: (?<TCount>[^\"]*)" |eval TCount=rtrim(TCount,"\\") |chart count(TCount) over TCount |appendcols [search |rex "Success: (?<S_Count>[^\"]*)"|eval S_Count=rtrim(S_Count,"\\") |chart count(S_Count) over S_Count]
|appendcols [search |rex "failed: (?<FCount>[^\"]*)"|eval F_Count=rtrim(FCount,"\\") |chart count(FCount) over FCount]

Can anyone help me on this to make it run faster. 

 

Thanks in Advance.

 

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Appendcols is almost always the wrong command.  I probably should do a B-Side talk on it, but for now just forget you ever heard of appendcols.

As for what you should do, well that depends on what you want the output to be.  Please share.

---
If this reply helps you, Karma would be appreciated.
0 Karma

rkishoreqa
Communicator

@richgalloway  I want the output as below. 

Value   SuccessCount          value    FailedCount           value       TotalCount
  1                  1                                 2               1                             3                      1

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This would be the rare case where appendcols is actually useful.

None of the alternatives I've tried work so it's a matter of making what you have work faster.  Use the usual methods for doing that: filter as much as and as soon as possible; reduce the time range as much as possible; make sure the data is well balanced among your indexers.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Your Guide to Splunk Digital Experience Monitoring

A flawless digital experience isn't just an advantage, it's key to customer loyalty and business success. But ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...