Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions local-testing/logging-pipeline.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Running a Logging Pipeline Locally
# Run a logging pipeline locally

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](https://docs.docker.com/compose/) which can serve as an example for testing other plugins locally.
You can test logging pipelines locally to observe how they handles log messages. This guide explains how to use [Docker Compose](https://docs.docker.com/compose/) to run Fluent Bit and Elasticsearch locally, but you can use the same principles to test other plugins.

## Create a Configuration File
## Create a configuration file

Refer to the [Configuration File section](https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/classic-mode/configuration-file) to create a configuration to test.

`fluent-bit.conf`:
Start by creating a [Fluent Bit configuration file](/administration/configuring-fluent-bit/classic-mode/configuration-file) to test.

{% code title="fluent-bit.conf" %}
```text
[INPUT]
Name dummy
Expand All @@ -18,13 +17,13 @@ Refer to the [Configuration File section](https://docs.fluentbit.io/manual/admin
Host elasticsearch
Replace_Dots On
```
{% endcode %}

## Docker Compose

Use [Docker Compose](https://docs.docker.com/compose/) to run Fluent Bit \(with the configuration file mounted\) and Elasticsearch.
## Use Docker Compose

`docker-compose.yaml`:
Use [Docker Compose](https://docs.docker.com/compose/) to run Fluent Bit (with the configuration file mounted) and Elasticsearch.

{% code title="docker-compose.yaml" %}
```yaml
version: "3.7"

Expand All @@ -42,20 +41,22 @@ services:
environment:
- discovery.type=single-node
```
{% endcode %}

## View indexed logs

To view indexed logs run:
To view indexed logs, run the following command:

```bash
curl "localhost:9200/_search?pretty" \
-H 'Content-Type: application/json' \
-d'{ "query": { "match_all": {} }}'
```

To "start fresh", delete the index by running:
## Reset index

To reset your index, run the following command:

```bash
curl -X DELETE "localhost:9200/fluent-bit?pretty"
```