Splunk Search

Show a particular column as the last column always

jiaqya
Builder

i have a table as below.

one two three four total five six

i want the "total" column to be shown at the end always, like below, need help to do this..

one two three four five six total.

also note that the column names are dynamic and can change, but "total" column name remains the same..

Tags (1)
0 Karma

jpolvino
Builder

Another way to do it:

| makeresults | fields - _time
| eval a=1,b=2,c=3,d=4
| eval Total=a+b+c
| table * Total

Using the table command, you can force the field order. In this example, it is saying "list all the fields but put Total at the end."

a   b   c   d   Total
1   2   3   4   6

jiaqya
Builder

did this using below:

|search query
|rename total as T
|eval total=T
|fields - T

this ends up the column total at the end, right most ..

0 Karma

jiaqya
Builder

did this using below:

|search query
|rename total as T
|eval total=T
|fields - T

this ends up the column total at the end, right most ..

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...