OpenSearch CLI

    Currently, opensearch-cli supports the Anomaly Detection and plugins, along with arbitrary REST API paths. Among other things, you can use opensearch-cli to create and delete detectors, start and stop them, and check k-NN statistics.

    Profiles let you easily access different clusters or sign requests with different credentials. opensearch-cli supports unauthenticated requests, HTTP basic signing, and IAM signing for Amazon Web Services.

    This example moves a detector () from a staging cluster to a production cluster:

    1. and extract the appropriate installation package for your computer.

      1. chmod +x ./opensearch-cli
    2. Confirm the CLI is working properly:

    Profiles let you easily switch between different clusters and user credentials. To get started, run opensearch-cli profile create with the --auth-type, --endpoint, and --name options:

    Alternatively, save a configuration file to ~/.opensearch-cli/config.yaml:

    1. profiles:
    2. - name: docker-local
    3. endpoint: https://localhost:9200
    4. password: foobar
    5. - name: aws
    6. aws_iam:
    7. profile: ""
    8. service: es

    For example, the following command retrieves information about a detector:

      For a request to the OpenSearch CAT API, try the following command:

      1. opensearch-cli curl get --path _cat/plugins --profile aws

      Use the -h or --help flag to see all supported commands, subcommands, or usage for a specific command: