Splunk Search

Struggling with a multi-log transaction

mgagliardi
Path Finder

I'm trying to establish a transaction. The information is in two different indexes, different sourcetypes, etc. Basically what I've got in index 1 is a bunch of XML-formatted Windows event log data...I'm able to successfully do the necessary search, run an spath on it to extract the field/value I need (a domain\username), etc. The other index contains pretty basic log data, including a field named "SlotID" that contains data formatted as domain\username. I'm also able to run a search successfully to grab that data. This is what the beginning of my search looks like:

host= (index=main sourcetype= Message=) OR (index=wineventlog EventID=800) | spath output=user path=Event.UserData.EventXML.param1 | eval lcuser=lower(user)

At that point if I go look at my search results I have all the data I need to get the transaction duration (which starts with the EventID=800 and ends with the log message). My problem is the common value resides in two differently-named fields (lcuser and SlotID). I have tried rename...but end up with only one event type "winning" (whichever one I rename last) and containing the new/renamed field). Same deal with eval to a new field...the last eval wins and the first eval no longer contains that field.

I'm lost and really hoping someone can lend a hand...been beating my head against the wall on this for the better part of 4 hours.

TIA!

1 Solution

mgagliardi
Path Finder

coltwanger's response was the (or at least a) correct answer, it worked for my use case.

View solution in original post

mgagliardi
Path Finder

coltwanger's response was the (or at least a) correct answer, it worked for my use case.

coltwanger
Contributor

Have you tried coalesce?

| eval combined=coalesce(lcuser, SlotID)

0 Karma

mgagliardi
Path Finder

Dude, you're a damn witch! That's got it 🙂 Thanks so much, you just ended my week on a positive note.

0 Karma

coltwanger
Contributor

Awesome! Have a great weekend 🙂

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...