Splunk Search

Order of columns after xyseries is unexpected

513239
Explorer

I am trying to arrange one of my column into rows. So I am using xyseries which is giving right results but the order of the columns is unexpected. Please help me to solve this.

My query is-

index=idx sourcetype=src1 |eval status=if(error,"status1",if(warning,"status2",if(debug,"status4","unknown"))) |stats count by field1 field2 field3 status |eval combination=mvappend(field1,field2,field3) |xyseries combination status count |rex combination "(?.)\s(?.)\s(?.*)"

I want result in below sequence-

field1 field2 status1 status2 status3 field3

But I am getting below result

field1 status1 status2 field2 field3 status3

513239
Explorer

I found the workaround for this. Specify field names for static one and "*" for dynamic fields.

|table field1 field2 * field3

ryhluc01
Communicator

Good Morning,

Can you select your answer?

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

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