Skip to content

Instantly share code, notes, and snippets.

@BlackMaria
Last active December 14, 2016 18:58
Show Gist options
  • Save BlackMaria/0e897a18f59ae2ddbb891eafdb66b8ef to your computer and use it in GitHub Desktop.
Save BlackMaria/0e897a18f59ae2ddbb891eafdb66b8ef to your computer and use it in GitHub Desktop.
#!/bin/bash
dir=elk
mkdir -p ${dir}/conf ${dir}/logs/
cd ${dir}
cat <<EOF> docker-compose.yml
elk:
image: sebp/elk
ports:
- "5601:5601"
- "9200:9200"
- "5044:5044"
volumes:
- ./logs:/logs
- ./conf:/etc/logstash/conf.d
- ./data:/var/lib/elasticsearch
EOF
cat <<EOF>conf/10-csv.conf
input {
file {
path => "/logs/*.csv"
start_position => "beginning"
}
}
filter {
csv {
columns => ["name", "last", "system", "moar headers"]
separator => ","
}
}
output {
elasticsearch {
}
stdout {}
}
EOF
docker-compose up -d
echo -e "zaboo,b,c,d\ne,f,g,h" >> logs/log.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment