Splunk Search

field combination does not work properly

can_surer
New Member

Hi,
I have the following search on splunk indexer.
Although field "a" and "b" return results, field "steps" does not return stable results.(only one or zero result is returned).
thanks

sourcetype="F5:iRule:WebAccess"|sort -req_elapsed_time|head 3|stats count by url client_address req_elapsed_time server_name|stats sum(count) as count list(url) as a list(server_name) as b by server_name | eval steps=b."-".a| fields steps count

Tags (2)
0 Karma
1 Solution

pedromvieira
Communicator

You can use mvexpand before your field concatenation.

  • mvexpand
    http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Mvexpand

    sourcetype="F5:iRule:WebAccess"| head 100000 | sort -req_elapsed_time|head 3|stats count by url client_address req_elapsed_time server_name|stats sum(count) as count list(url) as a list(server_name) as b by server_name | mvexpand a | mvexpand b | eval steps=b."-".a | fields steps count

View solution in original post

pedromvieira
Communicator

You can use mvexpand before your field concatenation.

  • mvexpand
    http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Mvexpand

    sourcetype="F5:iRule:WebAccess"| head 100000 | sort -req_elapsed_time|head 3|stats count by url client_address req_elapsed_time server_name|stats sum(count) as count list(url) as a list(server_name) as b by server_name | mvexpand a | mvexpand b | eval steps=b."-".a | fields steps count

can_surer
New Member

Thanks for your recommendation.
It solved my issue.

0 Karma

Ayn
Legend

eval won't like doing string concatenations on multivalued fields. It does that on single-valued fields only.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...