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

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...