bucketdir
bucketdir
Synopsis
Replaces a field value with higher-level grouping, such as replacing filenames with directories.
Syntax
bucketdir pathfield=<field> sizefield=<field> [maxcount=<int>] [countfield=<field>] [sep=<char>]
Required arguments
- pathfield
- Syntax: pathfield=<field>
- Description: Specify a field name that has a path value.
- sizefield
- Syntax: sizefield=<field>
- Description: Specify a numeric field that defines the size of bucket.
Optional arguments
- countfield
- Syntax: countfield=<field>
- Description: Specify a numeric field that describes the count of events.
- maxcount
- Syntax: maxcount=<int>
- Description: Specify the total number of events to bucket.
- sep
- Syntax: <char>
- Description: Specify either "/" or "\\" as the separating character. This depends on the operating system.
Description
Returns at most 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 SEP character. The default pathfield=source; sizefield=totalCount; maxcount=20; countfield=totalCount; sep="/" or "\\", depending on the os.
Examples
Example 1: Get 10 best sources and directories.
... | top source | bucketdir pathfield=source sizefield=count maxcount=10See also
Answers
Have questions? Visit Splunk Answers and see what questions and answers the Splunk community has using the bucket 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 , 4.3.1 , 4.3.2 , 4.3.3 , 4.3.4 , 4.3.5 , 4.3.6 , 5.0 , 5.0.1 , 5.0.2 View the Article History for its revisions.