Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/globalfishingwatch/elasticsearch-tool

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/globalfishingwatch/elasticsearch-tool

  • v0.0.0-20220705100710-b18615e07eb4
  • Source
  • Go
  • Socket score

Version published
Created
Source

elasticsearch-tool

Description

elasticsearch-tool is an agnostic CLI to expose commands which allow you to manage elasticsearch resources.

Format:

elasticsearch-tool [command] [--flags]

Tech Stack:

  • Golang
  • Cobra Framework
  • Viper
  • Docker

Git

Usage

There are available the following commands:

  • Add-Alias
  • Create-Index
  • Delete-Index

Command: [add-alias]

Add an alias to an index.

Flags
Required flags
  • --index-name= The destination index name.
  • --alias= The alias name.
  • --elastic-search-url= The Elasticsearch's URL.
Optional flags

No optional flags.

Example

Here an example of this command:

elasticsearch-tool add-alias 
    --index-name=gfw-task-2020 
    --alias=gfw-task-alias 
    --elastic-search-url=https://gfw:****@elasticsearch.globalfishingwatch.org

When you execute this command, under the hood happens the followings steps:

  • The CLI adds the alias for the index specified.

Command: [create-index]

Create a new index applying a custom mapping. Sometimes You would like to add a custom mapping for an index. You need to execute this command before import the data, otherwise, a default mapping will be created.

Flags
Required flags
  • --index-name= The destination index name.
  • --mapping= The mapping to destination index.
  • --elastic-search-url= The Elasticsearch's URL.
Optional flags

No optional flags.

Example

Here an example of this command:

elasticsearch-tool create-index 
  --index-name=test-track-data
  --mapping="{ \"properties\": { \"callsign\": { \"type\": \"text\", \"fields\": { \"keyword\": { \"type\": \"keyword\", \"ignore_above\": 256 } } } } }"
  --elastic-search-url="https://gfw:****@elasticsearch.globalfishingwatch.org" 

When you execute this command, under the hood happens the followings steps:

  • Create the index (if not exists)
  • Put the mapping defined in the JSON file.

Command: [delete-index]

Delete an index

Flags
Required flags
  • --index-name= The destination index name.
  • --elastic-search-url= The Elasticsearch's URL.
Optional flags

No optional flags.

Example

Here an example of this command:

elasticsearch-tool delete-index 
  --index-name=test-track-data
  --elastic-search-url="https://gfw:****@elasticsearch.globalfishingwatch.org" 


Command: [delete-indices-by-prefix]

Delete indices by prefix

Flags
Required flags
  • --index-prefix=` The prefix of the indices to delete.
  • --elastic-search-url= The Elasticsearch's URL.
Optional flags
  • --no-delete-index= Index name that you do not want to delete.
Example

Here an example of this command:

elasticsearch-tool delete-indices-by-prefix
  --index-prefix=test-track
  --no-delete-index=test-track-data
  --elastic-search-url="https://gfw:****@elasticsearch.globalfishingwatch.org" 

FAQs

Package last updated on 05 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc