Elasticsearch

target-elasticsearch (dtmirizzi variant)

Free and Open, Distributed, RESTful Search Engine

The target-elasticsearch loader sends data into Elasticsearch after it was pulled from a source using an extractor

Getting Started

Prerequisites

If you haven't already, follow the initial steps of the Getting Started guide:

  1. Install Meltano
  2. Create your Meltano project

Installation and configuration

  1. Add the target-elasticsearch loader to your project using
    meltano add
    :
  2. meltano add loader target-elasticsearch
  3. Configure the target-elasticsearch settings using
    meltano config
    :
  4. meltano config target-elasticsearch set --interactive

Next steps

If you run into any issues, learn how to get help.

Capabilities

The current capabilities for target-elasticsearch may have been automatically set when originally added to the Hub. Please review the capabilities when using this loader. If you find they are out of date, please consider updating them by making a pull request to the YAML file that defines the capabilities for this loader.

This plugin has the following capabilities:

  • about
  • stream-maps
  • schema-flattening

You can override these capabilities or specify additional ones in your meltano.yml by adding the capabilities key.

Settings

The target-elasticsearch settings that are known to Meltano are documented below. To quickly find the setting you're looking for, click on any setting name from the list:

You can also list these settings using

meltano config
with the list subcommand:

meltano config target-elasticsearch list

You can override these settings or specify additional ones in your meltano.yml by adding the settings key.

Please consider adding any settings you have defined locally to this definition on MeltanoHub by making a pull request to the YAML file that defines the settings for this plugin.

Scheme (scheme)

  • Environment variable: TARGET_ELASTICSEARCH_SCHEME
  • Default Value: http

http scheme used for connecting to elasticsearch


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set scheme [value]

Host (host)

  • Environment variable: TARGET_ELASTICSEARCH_HOST
  • Default Value: localhost

host used to connect to elasticsearch


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set host [value]

Port (port)

  • Environment variable: TARGET_ELASTICSEARCH_PORT
  • Default Value: 9200

port used to connect to elasticsearch


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set port [value]

Username (username)

  • Environment variable: TARGET_ELASTICSEARCH_USERNAME

basic auth username


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set username [value]

Password (password)

  • Environment variable: TARGET_ELASTICSEARCH_PASSWORD

basic auth password


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set password [value]

Bearer Token (bearer_token)

  • Environment variable: TARGET_ELASTICSEARCH_BEARER_TOKEN

bearer token for bearer authorization


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set bearer_token [value]

API Key Id (api_key_id)

  • Environment variable: TARGET_ELASTICSEARCH_API_KEY_ID

api key id for auth key authorization


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set api_key_id [value]

API Key (api_key)

  • Environment variable: TARGET_ELASTICSEARCH_API_KEY

api key for auth key authorization


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set api_key [value]

SSL CA File (ssl_ca_file)

  • Environment variable: TARGET_ELASTICSEARCH_SSL_CA_FILE

location of the the SSL certificate for cert verification ie. /some/path


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set ssl_ca_file [value]

Index Format (index_format)

  • Environment variable: TARGET_ELASTICSEARCH_INDEX_FORMAT
  • Default Value: ecs-{{ stream_name }}-{{ current_timestamp_daily }}

Index Format is used to handle custom index formatting such as specifying -latest index.

ie. the default index string defined as ecs-{{ stream_name }}-{{ current_timestamp_daily}} -> ecs-animals-2022-12-25 where the stream name was animals

Default options: Daily {{ current_timestamp_daily }} -> 2022-12-25, Monthly {{ current_timestamp_monthly }}-> 2022-12, Yearly {{ current_timestamp_yearly }} -> 2022.

You can also use fields mapped in index_schema_fields such as {{ x }} or {{ timestamp }}.

There are also helper functions such as: to daily {{ to_daily(timestamp) }}, to monthly {{ to_monthly(timestamp) }}, to yearly {{ to_yearly(timestamp) }}


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set index_format [value]

Index Schema Fields (index_schema_fields)

  • Environment variable: TARGET_ELASTICSEARCH_INDEX_SCHEMA_FIELDS

Index Schema Fields allows you to specify specific record values via jsonpath from the stream to be used in index formulation.

ie. if the stream record looks like {"id": "1", "created_at": "12-13-202000:01:43Z"} and we want to index the record via create time. we could specify a mapping like index_timestamp: created_at in the index_format we could use a template like ecs-animals-{{ to_daily(index_timestamp) }} this would put this record onto the index ecs-animals-2020-12-13


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set index_schema_fields [value]

Metadata Fields (metadata_fields)

  • Environment variable: TARGET_ELASTICSEARCH_METADATA_FIELDS

Metadata Fields can be used to pull out specific fields via jsonpath to be used on for ecs metadata patters

This would best be used for data that has a primary key. ie. {"guid": 102, "foo": "bar"} then create a mapping of _id: guid


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set metadata_fields [value]

Stream Maps (stream_maps)

  • Environment variable: TARGET_ELASTICSEARCH_STREAM_MAPS

Config object for stream maps capability. For more information check out Stream Maps.


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set stream_maps [value]

Stream Map Config (stream_map_config)

  • Environment variable: TARGET_ELASTICSEARCH_STREAM_MAP_CONFIG

User-defined config values to be used within map expressions.


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set stream_map_config [value]

Flattening Enabled (flattening_enabled)

  • Environment variable: TARGET_ELASTICSEARCH_FLATTENING_ENABLED

'True' to enable schema flattening and automatically expand nested properties. Elastic also naturally does this so this setting is less important.


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set flattening_enabled [value]

Flattening Max Depth (flattening_max_depth)

  • Environment variable: TARGET_ELASTICSEARCH_FLATTENING_MAX_DEPTH

The max depth to flatten schemas.


Configure this setting directly using the following Meltano command:

meltano config target-elasticsearch set flattening_max_depth [value]

Something missing?

This page is generated from a YAML file that you can contribute changes to.

Edit it on GitHub!

Looking for help?

If you're having trouble getting the target-elasticsearch loader to work, look for an existing issue in its repository, file a new issue, or join the Meltano Slack community and ask for help in the
#plugins-general
channel.

Install

meltano add loader target-elasticsearch

Maintenance Status

  • Maintenance Status
  • Built with the Meltano SDK

Repo

https://github.com/dtmirizzi/target-elasticsearch
  • Stars
  • Forks
  • Last Commit Date
  • Open Issues
  • Open PRs
  • Contributors
  • License

Maintainer

  • dtmirizzi

Meltano Stats

  • Total Executions (Last 3 Months)
  • Projects (Last 3 Months)

PyPI Stats

  • PyPI Downloads
  • PyPI Package Version

Keywords

  • meltano_sdk