Splunk: Playing with tables

table is one of the most basic Splunk commands. In general, adjusting tabular output to your needs is simple and most of the time you can get desired output by using table together with fields and rename. Things are a little bit more complicated when your table has dozens of columns (for instance when working with the output from Splunk's REST API produced by rest command). 

The key to be a successful Splunk Power User is to recognize that all three mentioned commands (table, fields, rename) accept wildcards. As per documentation, they take <wc-field> as arguments. This means that you can get the set of fields you need quite easily. For example:

| rest /services/saved/searches splunk_server=local
| table title, alert*




Even a standalone * is considered as a valid argument. This can be used to get your one selected column as the first one but keep everything else as it is. 

| rest /services/saved/searches splunk_server=local
| table title, search, *


BONUS
One more interesting command to check is transpose. It is especially useful when you need to inspect one multi-column record. As the name suggests, it converts columns to rows which makes the entry much more human readable. 

Comments

Popular posts from this blog

Splunk: Authentication with Discord? Wht not! (OAuth 2.0)

Study notes: Understanding DNSSEC

Linux: auditd fundamentals