Splunk Search

How to Bump a List with Data in Splunk to Get a Match

_gkollias
Builder

Hi All,

I have a list of invoice numbers that I want to try and find data for in Splunk. I added the list in a CSV but am having trouble getting other values in Splunk related to those InvoiceNumbers.

Here is where I have left off:

index=contract_gateway sourcetype=esb_audit bp_bp_name=Invoice 
| join type=outer InvoiceNumber [ | inputlookup ctg_invoice_check_lookup.csv | table InvoiceNumber ]

Along with this list I want to find other fields being logged (if they have even logged initally)...something like:

...| stats first(InvoiceNumber) as InvoiceNumber, latest(status) as exit_status, latest(other) as exit_message by bp_context_id 

is there a way to "append" these values with the list of invoice numbers in Splunk if they are being logged?

Thanks in advance!

0 Karma
1 Solution

lguinn2
Legend

Try it this way instead for your first search:

index=contract_gateway sourcetype=esb_audit bp_bp_name=Invoice [ | inputlookup ctg_invoice_check_lookup.csv 
 | table InvoiceNumber ]

This will retrieve the events with the InvoiceNumber(s) in the lookup table. I am unclear about the second part of your question, but you could try this:

... | stats first(InvoiceNumber) as InvoiceNumber, latest(status) as exit_status, latest(other) as exit_message 
       values(InvoiceNumber) as AllInvoices by bp_context_id

View solution in original post

lguinn2
Legend

Try it this way instead for your first search:

index=contract_gateway sourcetype=esb_audit bp_bp_name=Invoice [ | inputlookup ctg_invoice_check_lookup.csv 
 | table InvoiceNumber ]

This will retrieve the events with the InvoiceNumber(s) in the lookup table. I am unclear about the second part of your question, but you could try this:

... | stats first(InvoiceNumber) as InvoiceNumber, latest(status) as exit_status, latest(other) as exit_message 
       values(InvoiceNumber) as AllInvoices by bp_context_id

_gkollias
Builder

sorry for the late response on this.

This is exactly what I did - thanks for your response!

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...