Replaces a field value with higher-level grouping, such as replacing filenames with directories.
maxcount events, by taking the incoming events and rolling up multiple sources into directories, by preferring directories that have many files but few events. The field with the path is PATHFIELD (e.g., source), and strings are broken up by a separator character. The default pathfield=source; sizefield=totalCount; maxcount=20; countfield=totalCount; sep="/" or "\\", depending on the operation system.
bucketdir pathfield=<field> sizefield=<field> [maxcount=<int>] [countfield=<field>] [sep=<char>]
- Syntax: pathfield=<field>
- Description: Specify a field name that has a path value.
- Syntax: sizefield=<field>
- Description: Specify a numeric field that defines the size of bucket.
- Syntax: countfield=<field>
- Description: Specify a numeric field that describes the count of events.
- Syntax: maxcount=<int>
- Description: Specify the total number of events to bucket.
- Syntax: <char>
- Description: The separating character. Specify either a forward slash "/" or double back slashes "\\", depending on the operating system.
bucketdir command is a streaming command.
Return 10 best sources and directories.
... | top source | bucketdir pathfield=source sizefield=count maxcount=10
Have questions? Visit Splunk Answers and see what questions and answers the Splunk community has using the bucketdir command.
This documentation applies to the following versions of Splunk® Enterprise: 6.0, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.0.9, 6.0.10, 6.0.11, 6.0.12, 6.0.13, 6.0.14, 6.0.15, 6.1.1, 6.0.1, 6.1, 6.1.2, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 6.1.7, 6.1.8, 6.1.9, 6.1.11, 6.1.14, 6.1.10, 6.1.12, 6.1.13