Splunk Search

Error with subsearch

DonDandrea
Path Finder

I am new to creating subsearches and have completed a few of them successfully. This latest example is causing me a bit of greif.

I am trying to
1. do a stats count to provide error count in one search
2. sum a value to create a transaction count from a different data source
3. display the results in a table or chart like below

transactions 10000
errors 100

Here is my search
index=dspro sourcetype=telemetry | chart sum(TotalTransactions) as transaction_count [search index=dspro sourcetype=bootlogmaster (DSproSystem=Prod OR DSproSystem=Beta OR DSproSystem=Alph) | stats count as error_count] | chart, transaction_count, error_count

Here is the error it generates
Error in 'chart' command: The argument '( ( error_count=25045 ) )' is invalid.

Eventually I will want to create a third line in the chart that provides the percentage of errors.

Please help

Thank you
Don

Tags (2)
0 Karma

DonDandrea
Path Finder

Now we're talking. Thank you very much. You guys are awesome.

0 Karma

DonDandrea
Path Finder

That definately is a step closer. The only problem is that is doing a stats count to determine a value for transaction count. Transaction count needs to be determined by adding together all the values for the field TotalTransactions from the telemetry data.

0 Karma

somesoni2
Revered Legend

Try this

index=dspro (sourcetype=telemetry) OR (sourcetype=bootlogmaster (DSproSystem=Prod OR DSproSystem=Beta OR DSproSystem=Alph)) | stats sum(TotalTransactions) as transaction_count count(eval(sourcetype="bootlogmaster")) as error_count 
0 Karma

somesoni2
Revered Legend

Nice catch 🙂 , updated answer to correct this.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

I think you should replace count(eval(sourcetype="telemetry")) with sum(TotalTransactions).

0 Karma
Get Updates on the Splunk Community!

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...