[[exclude]]
== --exclude


[float]
Summary
~~~~~~~

IMPORTANT: This flag only functions within the scope of <<index-selection,index selection>> or <<snapshot-selection,snapshot selection>>.

Exclude indices or snapshots matching the provided pattern. Multiple items can
be excluded by using the `--exclude` flag multiple times with different
patterns.

WARNING: `--exclude` patterns _will not_ exclude anything added with the `--index` flag.

[float]
Flags
~~~~~

* `--exclude` A regular expression pattern. This flag can be invoked multiple
times.

[float]
Examples
~~~~~~~~

Show all indices, excluding indices beginning with log:

---------------------------------------
curator show indices --exclude '^log.*'
---------------------------------------

&nbsp;

Optimize all indices, excluding indices ending with `-prod` or `-qa`:

------------------------------------------------------------------
    curator show indices --exclude '^.*-prod$' --exclude '^.*-qa$'
------------------------------------------------------------------

&nbsp;

Delete all snapshots, excluding those with `2015` in the snapshot name. If the
default naming pattern is used, with `curator-YearMonthDayHourMinuteSecond` as
the pattern, and the year is 2015, this would effectively delete all `2014`
snapshots:

----------------------------------------------------------------------
curator delete snapshots --repository REPO_NAME --exclude '^.*2015.*$'
----------------------------------------------------------------------
