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!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...