es-apply-settings.pl - Run to apply a JSON list of settings to indexes matching a pattern
version 1.3
es-apply-settings.pl --local --pattern logstash-* settings.json
Options:
--help print help --manual print full manual --local Poll localhost and use name reported by ES --host|-H Host to poll for statistics --dry-run Don't apply settings, just tell me what you would do --local Assume localhost as the host --pattern Apply to indexes whose name matches this pattern --close Close the index, apply settings, and re-open the index --quiet Ideal for running on cron, only outputs errors --verbose Send additional messages to STDERR
This script allows you to change index settings on indexes whose name matches the specified pattern.
Usage:
$ es-apply-settings.pl --local --pattern logstash-* > { "index.routing.allocation.exclude.ip": "192.168.10.120" }
Or specify a file containing the settings
$ es-apply-settings.pl --local --pattern logstash-* settings.json
Patterns are used to match an index to the aliases it should have. A few symbols are expanded into regular expressions. Those patterns are:
* expands to match any number of any characters. ? expands to match any single character. DATE expands to match YYYY.MM.DD, YYYY-MM-DD, or YYYYMMDD ANY expands to match any number of any characters.
Print this message and exit
Optional, operate on localhost (if not specified, --host required)
Optional, the host to maintain (if not specified --local required)
REQUIRED: Use this pattern to match indexes
IMPORTANT: Settings are not dynamic, and the index needs to closed to have the settings applied. If this is set, the index will be re-opened before moving to the next index.
Only tell me what you would do, don't actually perform any action
Verbose stats, to not interfere with cacti, output goes to STDERR
Brad Lhotsky <brad@divisionbyzero.net>
This software is Copyright (c) 2012 by Brad Lhotsky.
This is free software, licensed under:
The (three-clause) BSD License
To install App::ElasticSearch::Utilities, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::ElasticSearch::Utilities
CPAN shell
perl -MCPAN -e shell install App::ElasticSearch::Utilities
For more information on module installation, please visit the detailed CPAN module installation guide.