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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...