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
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...