cga-kinesis-to-elasticsearch

command module
v0.0.0-...-9aa031f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2019 License: MIT Imports: 34 Imported by: 0

README

Kinesis to ElasticSearch

consume events from Kinesis data stream, apply grok patterns and write to ElasticSearch

local development

Start the dependencies (local Postgres, ElasticSearch and Kibana)

docker-compose up

kinesis, use local postgres for checkpointing, and write to the local Elastic Search Cluster.

APP_NAME=cloudfoundry_firehose \
STREAM_NAME=cloudfoundry_firehose \
CK_PROVIDER="postgres" \
CONNECTION_STRING="postgres://postgres:postgres@localhost/kinesis?sslmode=disable" \
TABLE_NAME=kinesis_consumer \
AWS_REGION=ap-southeast-2 \
AWS_SECRET_ACCESS_KEY=xxx \
AWS_ACCESS_KEY_ID=yyy \
ES_URL="http://localhost:9200" \
go run main.go
AWS ElasticSearch service and local postgres consumer checkpointing

Start local postgres to store checkpoint data

docker-compose up postgres

Read from kinesis and write to an AWS ElasticSearch Cluster.

APP_NAME=cloudfoundry_firehose \
STREAM_NAME=cloudfoundry_firehose \
CK_PROVIDER="postgres" \
CONNECTION_STRING="postgres://postgres:postgres@localhost/kinesis?sslmode=disable" \
TABLE_NAME=kinesis_consumer \
AWS_REGION=ap-southeast-2 \
AWS_SECRET_ACCESS_KEY=xxx \
AWS_ACCESS_KEY_ID=yyy \
ES_AWS_REGION=ap-southeast-2 \
ES_AWS_SECRET_ACCESS_KEY=aaa \
ES_AWS_ACCESS_KEY_ID=bbb \
ES_URL="https://search-abc-xyz-xxxxxxx.ap-southeast-2.es.amazonaws.com/" \
go run main.go

view logs at AWS Kibana endpoint

AWS ElasticSearch service and AWS DynamoDB consumer checkpointing

To use DynamoDB instead of Postgres

APP_NAME=cloudfoundry_firehose \
STREAM_NAME=cloudfoundry_firehose \
CK_PROVIDER="dynamo" \
TABLE_NAME="kinesis-to-elastic-consumer" \
AWS_REGION=ap-southeast-2 \
AWS_SECRET_ACCESS_KEY=xxx \
AWS_ACCESS_KEY_ID=yyy \
ES_AWS_REGION=ap-southeast-2 \
ES_AWS_SECRET_ACCESS_KEY=aaa \
ES_AWS_ACCESS_KEY_ID=bbb \
ES_URL="https://search-abc-xyz-xxxxxxx.ap-southeast-2.es.amazonaws.com/" \
go run main.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL