
Create distributed search groups
You can group your search peers to facilitate searching on a subset of them. Groups of search peers are known as "distributed search groups." You specify distributed search groups in the distsearch.conf
file.
For example, say you have a set of search peers in New York and another set in San Francisco, and you want to perform searches across peers in just a single location. You can do this by creating two search groups, NYC and SF.
In distsearch.conf
, create these stanzas:
[distributedSearch] # This stanza lists the full set of search peers. servers = 192.168.1.1:8089, 192.168.1.2:8089, 175.143.1.1:8089, 175.143.1.2:8089, 175.143.1.3:8089 [distributedSearch:NYC] # This stanza lists the set of search peers in New York. default = false servers = 192.168.1.1:8089, 192.168.1.2:8089 [distributedSearch:SF] # This stanza lists the set of search peers in San Francisco. default = false servers = 175.143.1.1:8089, 175.143.1.2:8089, 175.143.1.3:8089
This example creates two search groups, NYC and SF, which you can then specify in searches.
Note the following:
- The
servers
attribute lists groups of search peers by IP address and management port. - The servers list for each search group must be a subset of the list in the general
[distributedSearch]
stanza. - The group lists can overlap. For example, you can add a third group named "Primary_Indexers" that contains some peers from each location.
- If you set a group's
default
attribute to "true," the peers in that group will be the ones queried when the search does not specify a search group. Otherwise, if you set all groups to "false," the full set of search peers in the[distributedSearch]
stanza will be queried when the search does not specify a search group.
To use a search group in a search, specify the search group like this:
sourcetype=access_combined status=200 action=purchase splunk_server_group=NYC | stats count by product
This search runs against only the peers in the NYC location.
Note: This feature is not valid for indexer clustering. In indexer clustering, the cluster replicates data arbitrarily across the set of search peers, or "peer nodes". You cannot know whether any particular set of data will reside on any particular peer.
PREVIOUS Manage distributed server names |
NEXT Remove a search peer |
This documentation applies to the following versions of Splunk® Enterprise: 6.2.0, 6.2.1, 6.2.2, 6.2.3, 6.2.4, 6.2.5, 6.2.6, 6.2.7, 6.2.8, 6.2.9, 6.2.10, 6.2.11, 6.2.12, 6.2.13, 6.2.14, 6.2.15
Feedback submitted, thanks!