Works for moving to central elasticsearch database.

This commit is contained in:
ppatrik 2021-11-10 20:51:54 +01:00
parent b214db6e9d
commit 6b4d1eb4a1
9 changed files with 52 additions and 7 deletions

View file

@ -690,13 +690,28 @@ if "_jsonparsefailure" in [tags] { drop {} }
# Output section
output {
elasticsearch {
hosts => ["elasticsearch:9200"]
# With templates now being legacy and ILM in place we need to set the daily index with its template manually. Otherwise a new index might be created with differents settings configured through Kibana.
index => "logstash-%{+YYYY.MM.dd}"
template => "/etc/logstash/tpot_es_template.json"
# document_type => "doc"
}
# TODO: switch by auth config
#if "${MY_ELK_COLLECTOR_AUTH}" == "basic" {
elasticsearch {
hosts => ["${MY_ELK_COLLECTOR_HOST}"]
user => "${MY_ELK_COLLECTOR_USER}"
password => "${MY_ELK_COLLECTOR_PASSWORD}"
ssl => true
ssl_certificate_verification => false
# With templates now being legacy and ILM in place we need to set the daily index with its template manually. Otherwise a new index might be created with differents settings configured through Kibana.
index => "logstash-%{+YYYY.MM.dd}"
template => "/etc/logstash/tpot_es_template.json"
#document_type => "doc"
}
#} else {
# elasticsearch {
# hosts => ["${MY_ELK_COLLECTOR_HOST}"]
# # With templates now being legacy and ILM in place we need to set the daily index with its template manually. Otherwise a new index might be created with differents settings configured through Kibana.
# index => "logstash-%{+YYYY.MM.dd}"
# template => "/etc/logstash/tpot_es_template.json"
# #document_type => "doc"
# }
#}
#if [type] == "Suricata" {
# file {

View file

@ -14,6 +14,7 @@ services:
# condition: service_healthy
env_file:
- /opt/tpot/etc/compose/elk_environment
- /opt/tpot/etc/compose/elk_collector
image: "dtagdevsec/logstash:2006"
volumes:
- /data:/data

View file

@ -167,6 +167,7 @@ services:
condition: service_healthy
env_file:
- /opt/tpot/etc/compose/elk_environment
- /opt/tpot/etc/compose/elk_collector
image: "dtagdevsec/logstash:2006"
volumes:
- /data:/data

View file

@ -0,0 +1,8 @@
MY_ELK_COLLECTOR_HOST=elasticsearch:9200
MY_ELK_COLLECTOR_AUTH=none
# MY_ELK_COLLECTOR_HOST=https://you_collector_ip:64297/es/
# MY_ELK_COLLECTOR_AUTH=basic
# Password have to be created at collector host at file /data/nginx/conf/nginxpasswd
# MY_ELK_COLLECTOR_USER=username
# MY_ELK_COLLECTOR_PASSWORD=password

View file

@ -374,6 +374,7 @@ services:
condition: service_healthy
env_file:
- /opt/tpot/etc/compose/elk_environment
- /opt/tpot/etc/compose/elk_collector
image: "dtagdevsec/logstash:2006"
volumes:
- /data:/data

View file

@ -151,6 +151,7 @@ services:
condition: service_healthy
env_file:
- /opt/tpot/etc/compose/elk_environment
- /opt/tpot/etc/compose/elk_collector
image: "dtagdevsec/logstash:2006"
volumes:
- /data:/data

View file

@ -537,6 +537,7 @@ services:
condition: service_healthy
env_file:
- /opt/tpot/etc/compose/elk_environment
- /opt/tpot/etc/compose/elk_collector
image: "dtagdevsec/logstash:2006"
volumes:
- /data:/data

View file

@ -535,3 +535,19 @@ services:
volumes:
- /data:/data
- /data/ews/conf/ews.ip:/opt/ewsposter/ews.ip
## Logstash service
logstash:
container_name: logstash
restart: always
# environment:
# - LS_JAVA_OPTS=-Xms2048m -Xmx2048m
depends_on:
elasticsearch:
condition: service_healthy
env_file:
- /opt/tpot/etc/compose/elk_environment
- /opt/tpot/etc/compose/elk_collector
image: "dtagdevsec/logstash:2006"
volumes:
- /data:/data

View file

@ -550,6 +550,7 @@ services:
condition: service_healthy
env_file:
- /opt/tpot/etc/compose/elk_environment
- /opt/tpot/etc/compose/elk_collector
image: "dtagdevsec/logstash:2006"
volumes:
- /data:/data