Skip to content

add a set of envs in a set of beats from env shell file source

License

Notifications You must be signed in to change notification settings

zbioe/beats-keystore-add

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Beats Keystore Add

Add in beats keystores a set of keys setted from key file

Usage

to get help use: ./beats-keystore-add.sh -h

Usage:
  ./beats-keystore-add.sh [OPTION]...

Options:
  -h, --help                 Show this message
  -b, --beat <beatname>      Chose beats who will append the pass in keystore (Default metricbeat)
  -f, --keys-file <filename> use the file as input to create keys in keystore (Default .beatkeys)
  -q, --quiet, --silent      Silent mode
  -d, --debug                Debug mode

By Env:
  For pass parameters as Env
  BEATS    - space separated list of beats
  KEYS_FILE - path of keys file

Examples:
  ./beats-keystore-add.sh --help
  ./beats-keystore-add.sh --debug -v -b metricbeat
  ./beats-keystore-add.sh --beat metricbeat --beat filebeat --keys-file all_keys
  BEATS="journalbeat auditbeat" KEYS_FILE="awesome_keys.kv" ./beats-keystore-add.sh -d

Beats:
  metricbeat
  filebeat
  heartbeat
  packetbeat
  auditbeat
  journalbeat

KeysFile:
  file in format of key=value
  Format:
    key=value

  Example:
    # Cool Service
    SERVICE_NAME=coolname
    SERVICE_PASS=Str0ngP455

    # Another
    ANOTHER_CS=connection_string://0.0.0.0:88

    # STRANGE
    STRANGE_KEY=nice pass very long, with spaces and :=ç =ll.2\/d103d 1 0~;/ af "'ç

Example Key File

example of key-file used in beats

# .beatkeys

## elasticsearch
ES_USER=esuser
ES_PASS=STRONGPASS

## kibana
KIBANA_USER=kibanauser
KIBANA_PASS=STRONG'KIBANA"PASS!@~;çHERE

then you can use it in call of module

- module: elasticsearch
  xpack.enabled: true
  period: 10s
  hosts:
    - https://node1.coolhost.com:9200
    - https://node2.coolhost.com:9200
  protocol: https
  username: "${ES_USER}"
  password: "${ES_PASS}"

About

add a set of envs in a set of beats from env shell file source

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages