#1 Splunk sub(Commands) [top, rare, fields, table, rename, sort]

TOP: Will show you top results with respect to your field.
  • Example: index=_internal | top limit=5 component







RARE: Will help you to find out least common values of a field, i.e. it is similar to TOP but works in opposite direction.
  • Example: index=_internal | rare limit=5 component







FIELDS: Will help you to limit your columns, lets say you want to remove count from above table, fields can help you to achieve that. Though there are other usage of fields as well but you will learn slowly and gradually when you start building some complex queries.
  • Example: index=_internal | top limit=5 component | fields component, percent








TABLE: Same thing can be achieved via table as well.
  • Example: index=_internal | top limit=5 component | table component, percent







RENAME: Lets say you want to rename a column, for that you can use rename command.
  • Example: index=_internal | top limit=5 component | rename percent AS percentage | table component, percentage







SORT: Helps you to sort the values with respect to a field, you can sort in both the directions ascending and descending order.
  • Example: index=_internal | top limit=5 component | table component, percent | sort component






  • If you want to sort in another direction, use '-' without the quotes.
    • sort - component

Comments

Popular posts from this blog

#3 Splunk sub(Commands) [eval, round, trim, stats, ceil, exact, floor, tostring]

#6 Splunk sub(Commands) [fields, rename, replace, table, transaction]

#2 Splunk sub(Commands) [eval, trim, chart, showperc, stats, avg]