rename
rename
Synopsis
Renames a specified field (wildcards can be used to specify multiple fields).
Syntax
rename wc-field AS wc-field
Required arguments
- wc-field
- Syntax: <string>
- Description: The name of a field and the name to replace it. Can be wildcarded.
Description
Use the rename command to rename fields. This command is useful for giving fields more meaningful names.
You cannot rename one field with multiple names. For example if you had a field A, you can't do "A as B, A as C" in one string.
... | stats first(host) AS site, first(host) AS reportUse quotes to rename a field to a phrase:
... | rename SESSIONID AS "session ID"If both the source and destination fields are wildcard expressions with he same number of wildcards, the renaming will carry over the wildcarded portions to the destination expression.
Use wildcards to rename multiple fields:
... | rename *ip AS "IP address"Examples
Example 1: Rename the "_ip" field as "IPAddress".
... | rename _ip as IPAddressExample 2: Rename fields beginning with "foo".
... | rename foo* as bar*Example 3: Rename the "count" field.
... | rename count as "Count of Events"See also
Answers
Have questions? Visit Splunk Answers and see what questions and answers the Splunk community has using the rename command.
This documentation applies to the following versions of Splunk: 4.1 , 4.1.1 , 4.1.2 , 4.1.3 , 4.1.4 , 4.1.5 , 4.1.6 , 4.1.7 , 4.1.8 , 4.2 , 4.2.1 , 4.2.2 , 4.2.3 , 4.2.4 , 4.2.5 , 4.3 View the Article History for its revisions.