Splunk Search

What is the right way to Join?

rochapablo
Engager

I've been searching how to join, but every example that I apply seems to be wrong.

I've got referents type of log:

app=my_app_name INFO controller=MyController method=myMethod transaction=999
app=my_app_name INFO controller=MyOtherController transaction_id=999
app=my_app_name INFO controller=CheckoutController params[transaction_id]=999

As you can see, I always have the transaction id in different keys.

So I'm trying to join like this:

index=my_app_name | join "params[transaction_id]" [ search  index=my_app_name transaction_id ] | fields controller

But like i said, it seems not to be working, because I've always got some result rows that don't make sense, like:

app=my_app_name INFO controller=CheckoutController order_id=99
Tags (1)
0 Karma
1 Solution

woodcock
Esteemed Legend

Try this:

... | rex "params\[transaction_id\]=(?<transaction_id>\d+)" | stats values(*) AS * by transaction_id

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

Here's a pretty good writeup to get you started on not joining at all: http://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-joi...

0 Karma

woodcock
Esteemed Legend

Try this:

... | rex "params\[transaction_id\]=(?<transaction_id>\d+)" | stats values(*) AS * by transaction_id
Get Updates on the Splunk Community!

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

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...