Knowledge Management

Not result get from collect

Wendy1990
New Member

I schedule below search, search name is "TransactionResult"

sourcetype="ims*" host="chi*" ActivityId!="(null)" (Action="Start" OR Action="End") | eval TopicName= mvindex(split(TopicName,"."),-1) | transaction ActivityId TopicName startswith="Start" endswith="End" maxevents=2 | fields FirmName ActivityId TopicName duration _time | collect addtime=true index=summary_abuse

After above search completed, I use

"index=summary_abuse search_name="TransactionResult" to get the result of search , but the result is empty ,why?

Tags (2)
0 Karma
1 Solution

alacercogitatus
SplunkTrust
SplunkTrust

I don't think search_name is the right field to use here.

Did you try:

index=summary_abuse source="TransactionResult"

View solution in original post

0 Karma

masonmorales
Influencer

Best practice is to use a marker, which creates a new key/value pair in each SI result. The marker then allows you to easily retrieve the results you want from the SI.

Here's how you can add it to your search:

sourcetype="ims*" host="chi*" ActivityId!="(null)" (Action="Start" OR Action="End") | eval TopicName= mvindex(split(TopicName,"."),-1) | transaction ActivityId TopicName startswith="Start" endswith="End" maxevents=2 | fields FirmName ActivityId TopicName duration _time | collect addtime=true index=summary_abuse marker="si_search_name=TransactionResult"

Then, to retrieve the results, you just do:

index=summary_abuse si_search_name=TransactionResult

alacercogitatus
SplunkTrust
SplunkTrust

I don't think search_name is the right field to use here.

Did you try:

index=summary_abuse source="TransactionResult"
0 Karma

Wendy1990
New Member

Transaction can calculate duration, but I don't see the field duration value for each ActivityId.

0 Karma

Wendy1990
New Member

I want to save the result of transaction command, now I can see the event with your command, but duration value is null, why?
I use this command
index=summary source="transtest" | table FirmName ActivityId TopicName duration _time

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...