Splunk Search

Pass a variable form subsearch but it should not be used in parent search.

max_jay
New Member

I have two logs. First log contain start date and end date in second log.
First log query :
index=abc sourcetype=abc_agent_perf | eval sourceCreateDate=strptime(TimestampStart,"%Y-%m-%d %H:%M:%S”)

Second log query:
index=abc sourcetype=abcperf | eval endDate=strptime(CreateDateTime,"%Y-%m-%dT%H:%M:%S.%3NZ")

Both logs have GUID in common. But its ParentEventGUID in second and EventGUID in first. So have modified second query.
index=abc sourcetype=abcperf | eval endDate=strptime(CreateDateTime,"%Y-%m-%dT%H:%M:%S.%3NZ") | rename ParentEventGUID as EventGUID

I used subquery to combine both search.
index=abc sourcetype=abc_agent_perf [index=abc sourcetype=abcperf | eval endDate=strptime(CreateDateTime,"%Y-%m-%dT%H:%M:%S.%3NZ") | rename ParentEventGUID as EventGUID | fields + EventGUID ]| eval endDate=strptime(CreateDateTime,"%Y-%m-%dT%H:%M:%S.%3NZ")

But am not able to send endDate. If i send endDate from subquery because it is considered as search field and no result are returned.
I have to calculate difference between start and end date and plot a timechart graph.

Please let us know how to pass endDate without considered as search criteria. If there is another way, please point me in that direction.

Thanks in advance!

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...