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

FIELDS: This command helps to keep or remove specified fields from the search results, below command will keep just three fields in your search result.
  • Example: | fields request, rc, pt

RENAME: This command helps to rename field(s), below command will rename a field named as service to serviceType and RC as responseCode
  • Example: | rename service AS serviceType, RC AS responseCode

REPLACE: This command helps to replace the values of fields with another value, below command will replace the values "fetchReport" and "viewReport" as "Report" in "serviceType' field.
  • Example: | replace fetchReport with Report, viewReport with Report in serviceType

TABLE: This command helps to format the results into tabular output.
  • Example: | table request, rc, pt

TRANSACTION: This command helps to merge events into a single event based upon a common identifier, below command will create events based on two events i.e. it will fetch the txn-id which startswith "request-in" and endswith "request-out" and further it will discard all the events in which either of the value is missing.
  • Example: | transaction txn-id startswith=request-in endswith=request-out keeporphans=false

Comments

Popular posts from this blog

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

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