Splunk Search

map question

brdr
Contributor

I'm getting some strange results with the map command. This is what I need to do... in one index (1st search) I have 'action' , 'host', and '_time' field. The other search (2nd search) is used in the map using fields 'user' and '_time'. I need to extract the field 'user' where the '_time' fields are very close together (few minutes) in both indexes. My result when I run the search I get duplicate rows and more events. Thanks for your help.

|index=myindex1 
| eval my_earliest=_time
| eval my_latest=relative_time(_time, "+3m")
| sort _time
| table action host my_earliest my_latest
| map search="search index=myindex2 (_time > my_earliest AND _time < my_latest) | dedup user | sort _time |eval action=$action$, host=$host$" maxsearches=500
| table user action host _time
Tags (1)
0 Karma

brdr
Contributor

i forgot the '$' around the my earliest and latest variables in the search.. doh.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...