You may wish to test a logging pipeline locally to observe how it deals with log messages. The following is a walk-through for running Fluent Bit and Elasticsearch locally with Docker Compose which can serve as an example for testing other plugins locally.
Refer to the Configuration File section to create a configuration to test.
fluent-bit.conf
:
[INPUT]Name dummyDummy {"top": {".dotted": "value"}}​[OUTPUT]Name esHost elasticsearchReplace_Dots On
Use Docker Compose to run Fluent Bit (with the configuration file mounted) and Elasticsearch.
docker-compose.yaml
:
version: "3.7"​services:fluent-bit:image: fluent/fluent-bitvolumes:- ./fluent-bit.conf:/fluent-bit/etc/fluent-bit.confdepends_on:- elasticsearchelasticsearch:image: elasticsearch:7.6.2ports:- "9200:9200"environment:- discovery.type=single-node
To view indexed logs run:
curl "localhost:9200/_search?pretty" \-H 'Content-Type: application/json' \-d'{ "query": { "match_all": {} }}'
To "start fresh", delete the index by running:
curl -X DELETE "localhost:9200/fluent-bit?pretty"