The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

es-apply-settings.pl - Run to apply a JSON list of settings to indexes matching a pattern

VERSION

version 1.005

SYNOPSIS

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

DESCRIPTION

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

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.

OPTIONS

help

Print this message and exit

manual

Print this message and exit

local

Optional, operate on localhost (if not specified, --host required)

host

Optional, the host to maintain (if not specified --local required)

pattern

REQUIRED: Use this pattern to match indexes

close

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.

dry-run

Only tell me what you would do, don't actually perform any action

verbose

Verbose stats, to not interfere with cacti, output goes to STDERR

AUTHOR

Brad Lhotsky <brad@divisionbyzero.net>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2012 by Brad Lhotsky.

This is free software, licensed under:

  The (three-clause) BSD License