top of page

Tabulating fields with the "Table" command

1 day ago
2 min read

Splunk treats your data as events and displays them as lines or in json format, according to the timestamp of each event. This view is not very practical, since you have to look for the parts of the log that hold the values of the fields shown in the left sidebar. That's where this command comes in: table.


The table command tabulates the fields available in the search, making the data easier to view.


Below is an example of the table command, creating a table with the data from the index web.


index=web | table *

The asterisk (*) means that all fields should be shown in the table, but you can choose which fields to show by passing the field names in the query.


The following example shows the _time, host and clientip fields (the order of the fields was chosen at random):


index=web |  table host clientip status


You can also show the listed fields first and then all the others, just by adding an asterisk (*) after the list of fields.


index=web |  table host clientip status *

Finally, we can show all fields that start with a specific prefix by adding an asterisk (*) to the prefix.


index=web |  table date*

Want to practice? Try the free We Challenge sample, with Splunk questions and explanations.

To start from scratch, see the Introduction to Splunk course on Udemy (in Portuguese). For your team, see WeValuate's Splunk training.


Questions about the post? Content suggestions? Corrections? Criticism or praise?

Please contact us at wevaluatebr@gmail.com and we will reply as soon as possible.


If you liked it, share this post on your social networks and help us spread the word!



Comments


bottom of page