Splunk Search

order changing with the table command ??

rakesh_498115
Motivator

Hi.

When i am using the table command ? i am not getting the fields in the order i have ginen ??
how can i do it be in the same order which i have mentioned ??

my query is :

soucetype="mydata" | table _raw,Recieved,Sent

i want this order of display . but i am gettin in Received,Sent,_raw in this order ..pls help..i want the same order mentiond with the table commmand ..

Tags (1)
0 Karma
1 Solution

MuS
Legend

Hi

it took me some reading the docs and trying out of some commands and I got what you are looking for 😉

the easiest way is to rename _raw to anything and use the new field name in the table:

 soucetype="mydata" | rename _raw as newraw | table newraw, Recieved, Sent

there are probably more effective ways of doing this, but it worked for example you provided and it answers your question.

cheers,

MuS

View solution in original post

arihant16cse
Path Finder

| table Receive,sent,_raw

0 Karma

rajeev_ku
Path Finder

Best way to do it as below
soucetype="mydata" | rename _raw as newraw | table Recieved, Sent, newraw
it will adjust raw data at most right position.

0 Karma

MuS
Legend

Hi

it took me some reading the docs and trying out of some commands and I got what you are looking for 😉

the easiest way is to rename _raw to anything and use the new field name in the table:

 soucetype="mydata" | rename _raw as newraw | table newraw, Recieved, Sent

there are probably more effective ways of doing this, but it worked for example you provided and it answers your question.

cheers,

MuS

rakesh_498115
Motivator

Thans Mus .. i got it now ..:)

0 Karma

MuS
Legend

rakesh, sorry but I hope you are aware that you can scroll a windows not only up and down but also to the left or to the right? _raw is usually very long, therefore received and sent are WAY ON THE RIGHT of your screen.

0 Karma

rakesh_498115
Motivator

Hi MuS,

when i am used like this..i am getting the newraw values alone...Received , Sent are not at all displayin ..pls help..

0 Karma

Ayn
Legend

Use fields.

fields _raw,Received,Sent
0 Karma

rakesh_498115
Motivator

fields command is not working like this .... 😞

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

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...