Getting Data In

Using an outer join with an inputlookup file

jsmith39
Path Finder

I'm trying to match the dates on specific event logs with an inputlookup file. I've done this in the past and it has worked perfectly but for some reason, in this case the data is not coming back as expected and I'm hoping someone can shine a light on the issue.

My inputlookup csv file is just one column with a list of county names in it. My query is looking through event logs to find a specific event, then parse the date down to a specific format and return that result next to the county name. The interesting field is db_name which corresponds exactly to the county name field.

So my expected results are
County DB Backup
Albany Thursday, July, 10th, 2014
Broome Thursday, July, 10th, 2014
....

What is happening instead is I'm getting the above results but instead of db_name Albany being matched up to County Albany, the query has grabbed one database record and populated the entire list with it.

| inputlookup counties.csv | join type=outer [search host=main_server EventCode=17055 | sort -_time | dedup db_name | eval "DB Backups"=strftime(_time, "%A, %b %d, %Y")] | table County "DB Backups"

Tags (2)

somesoni2
Revered Legend

I see the join field name is not specified and that could be the reason for that behaviour.
Try this

| inputlookup counties.csv | join type=left County [search host=main_server EventCode=17055 | sort -_time | dedup db_name | eval "DB Backups"=strftime(_time, "%A, %b %d, %Y")] | table County "DB Backups"

Updated

Try this

host=main_server EventCode=17055 | sort -_time | dedup db_name | eval "DB Backups"=strftime(_time, "%A, %b %d, %Y") | table County "DB Backups" | append [ | inputlookup counties.csv ] | stats values("DB Backups") as "DB Backups" by County
0 Karma

somesoni2
Revered Legend

Try the updated answer (mimicing full outer join)

0 Karma

jsmith39
Path Finder

Thank you for replying, unfortunately that didn't work. It did keep Splunk from returning the same record repeatedly, but it ended up not returning any data other than the County list that is part of the .csv file.

I removed the | table ... to see what all was being returned but all of the fields except for county were empty,

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.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 ...