App-ElasticSearch-Utilities
view release on metacpan or search on metacpan
scripts/es-apply-settings.pl view on Meta::CPAN
#------------------------------------------------------------------------#
# Documentations!
pod2usage(1) if $opt{help};
pod2usage(-exitstatus => 0, -verbose => 2) if $opt{manual};
#------------------------------------------------------------------------#
# Figure out the skipped aliases
my %SKIP = map { $_ => 1 } (
qw( .hold .do_not_erase ),
$opt{'skip-alias'} ? ( @{ $opt{'skip-alias'} } ) : (),
);
# Read JSON Settings
my $RawJSON = '';
$RawJSON .= $_ while <>;
my $settings = undef;
eval {
$settings = decode_json $RawJSON;
scripts/es-apply-settings.pl view on Meta::CPAN
=item B<older>
When this option is used along with the --days option the the setting will only be applied
to indexs that are older than the days specified.
es-apply-settings.pl --older --days 30 --pattern logstash-*
=item B<skip-alias>
Protected aliases, which if present will cause the application of settings to
be skipped for a particular index. The aliases C<.hold> and C<.do_not_erase>
will always be skipped.
=item B<no-skip>
Apply settings to all matching indexes, regardless of the protected aliases.
=item B<no-diff>
During a normal run, the settings you're requesting will be checked against the
indices and only indices with settings out of line with the desired settings
scripts/es-daily-index-maintenance.pl view on Meta::CPAN
}
else {
my $operate = 0;
foreach my $mode (@MODES) {
$operate++ if $CFG{$mode};
last if $operate;
}
pod2usage(-message => "No operation selected, use --close, --delete, --optimize, or --replicas.", -exitval => 1) unless $operate;
}
# Set skip alias hash
push @{ $CFG{'skip-alias'} }, qw( .hold .do_not_erase );
my %SKIP = map { $_ => 1 } @{ $CFG{'skip-alias'} };
# Can't have replicas-min below 0
$CFG{'replicas-min'} = 0 if $CFG{'replicas-min'} < 0;
# Create the target uri for the ES Cluster
my $es = es_connect();
# This setting is no longer supported
output({color=>'red',sticky=>1,stderr=>1}, "WARNING: The index.codec.bloom.load is now disabled as of v1.4")
scripts/es-daily-index-maintenance.pl view on Meta::CPAN
=item B<skip-alias>
Can be set more than once. Any indexes with an alias that matches this list is
skipped from operations. This is a useful, lightweight mechanism to preserve
indexes.
--skip-alias preserve --skip-alias pickle
In addition to user specified aliases, the aliases C<.hold> and
C<.do_not_erase> will always be excluded.
=back
=head1 AUTHOR
Brad Lhotsky <brad@divisionbyzero.net>
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2024 by Brad Lhotsky.
( run in 0.317 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )