Splunk Search

Reordering fields

mnj1809
Path Finder

Hello Splunkers,

I've a Region filter over the dashboard. This Region filter has values AMER and EMEA.

 

mnj1809_0-1705319723804.png

I've a requirement to reorder the above fields based on the selection of Region filter as follows. I want "<Region> Mandatory" field to be appear before "<Region> All"

mnj1809_1-1705320516370.png

Thanks in advance.

@tscroggins @yuanliu @bowesmana 

 

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try putting an extra space before Mandatory so that lexicographical sorting will prioritise above single spaced values

| foreach "* Mandatory"
    [| rename "<<FIELD>>" as "<<MATCHSEG1>>  Mandatory"]

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try putting an extra space before Mandatory so that lexicographical sorting will prioritise above single spaced values

| foreach "* Mandatory"
    [| rename "<<FIELD>>" as "<<MATCHSEG1>>  Mandatory"]
0 Karma

mnj1809
Path Finder

Thanks @ITWhisperer. It work like a charm.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @mnj1809,

could you share your search and the possible values for regions in text mode?

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...