Two type of log records exist in our Splunk:
1st record format:
Transfer money { "accountNo" : "123" , "transaction-id":"1234567890" }
2nd record format:
[1234567890] Transfer failed, mainframe is offline
the first record is just the details of the transaction where 1234567890 is the transaction-id. The second record is just a log of the details of the exception that happened in the transaction. The value inside [] is the transaction-id of the transaction that had the exception.
In my splunk query, I want to list all transfer money transactions initiated by account = 123 that resulted in failure with details "Transfer failed, mainframe is offline"
Is this even possible to do? I did some bit of research that found joins can be used for this but how can you extract the transaction-id and use it as common field value for the join?
Your developers did you no service by creating log messages with such different formats. It's still possible to do it, however.
Yes, a
joincan be used, but should be avoided.I'll explain using example code. Start by reading the events of interest: "Transfer money" and "Transfer failed, mainframe is offline".