Splunk Search

What is the precedence of common fields between the main search and subsearch after a join?

bowesmana
SplunkTrust
SplunkTrust

I have two types of log entry with a common field. I am using join to get the

index=web_load sourcetype=instrument i_tx=func1 i_status=0 | join i_bid [ search index=web_load sourcetype=instrument i_tx=func2 ] ...

The join is fine, but I am not sure what happens to fields that are in both rows with func1 and func2. I have a field i_elapsed which is the elapsed time for the function, but I am interested in min/avg/max stats about the i_elapsed field from the rows relating to func2. I can see a difference in my results if I reverse func1 and func2 round in the search, but am not sure what the rule is about common fields in the join.

0 Karma
1 Solution

somesoni2
Revered Legend

Whether join subsearch fields overwrite the fields from main search is decided by following property of the join command.

overwrite
Syntax: overwrite=<bool>
Description: Indicates whether fields from the subresults overwrite the fields from the main results, if the fields have the same field name.
Default: true

By default the common field names would be overwritten. So, the query in the question should give you the desired result (using i_elapsed from func2/subsearch)

View solution in original post

somesoni2
Revered Legend

Whether join subsearch fields overwrite the fields from main search is decided by following property of the join command.

overwrite
Syntax: overwrite=<bool>
Description: Indicates whether fields from the subresults overwrite the fields from the main results, if the fields have the same field name.
Default: true

By default the common field names would be overwritten. So, the query in the question should give you the desired result (using i_elapsed from func2/subsearch)

bowesmana
SplunkTrust
SplunkTrust

Duh RTFM!! I trawled through that page before I posted 😞 Just the answer I needed. Thanks!

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...