|
| 1 | +# Ingest Custom Sources into Sentinel-Kit Indexer |
| 2 | + |
| 3 | +**Sentinel-Kit** natively supports multiple direct log ingestion modes by placing log files in the subdirectories of `/data/log_ingest_data`. |
| 4 | +It also includes an HTTP forwarder for JSON-formatted log ingestion — see the [Ingest logs](04-ingest-logs.md) section for details. |
| 5 | + |
| 6 | +However, for advanced use cases, you may want to create your own custom ingestion source. |
| 7 | +Sentinel-Kit uses **Fluent Bit** as its log ingestion engine, which can be directly extended to handle additional sources. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## Data Inputs and Parsers |
| 12 | + |
| 13 | +All Fluent Bit configuration files are loaded from the `/config/fluentbit_server` directory. |
| 14 | +The main configuration file is `fluent-bit.conf`, which references other configuration files as needed. |
| 15 | + |
| 16 | +It is recommended to create one configuration file per log source type for better readability and maintainability. |
| 17 | +Each existing ingestion configuration in Sentinel-Kit can be found in this same directory. |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Data Filters and Transformations |
| 22 | + |
| 23 | +Data transformations can be applied using Fluent Bit’s native filters, or through custom code extensions using **Lua scripts**. |
| 24 | +You can also use the **`exec`** plugin to execute shell commands directly within the container. |
| 25 | + |
| 26 | +Several working examples are already available within existing Sentinel-Kit source configurations. |
| 27 | +For more advanced usage, refer to the [official Fluent Bit documentation](https://docs.fluentbit.io/manual) and community resources. |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## Output to Elasticsearch |
| 32 | + |
| 33 | +By default, logs are forwarded to **Elasticsearch** using the following configuration: |
| 34 | + |
| 35 | +```bash |
| 36 | +[OUTPUT] |
| 37 | + Name es |
| 38 | + Match __SETUP_YOUR_INPUT_TAG_HERE__ |
| 39 | + Host sentinel-kit-db-elasticsearch-es01 |
| 40 | + Port 9200 |
| 41 | + Buffer_Size 5M |
| 42 | + Logstash_Format On |
| 43 | + Logstash_Prefix __SET YOUR ELASTICSEARCH INDEX PATTERN HERE__ |
| 44 | + Logstash_DateFormat %Y.%m.%d |
| 45 | + Type _doc |
| 46 | + Time_Key @timestamp |
| 47 | + Replace_Dots On |
| 48 | + Suppress_Type_Name On |
| 49 | + Retry_Limit False |
| 50 | + TLS On |
| 51 | + TLS.Verify Off |
| 52 | + HTTP_User elastic |
| 53 | + HTTP_Passwd ${ELASTIC_PASSWORD} # Do not modify this line — it is injected via environment variables for authentication |
| 54 | +``` |
| 55 | + |
| 56 | +## Applying Configuration Changes |
| 57 | + |
| 58 | +To activate your new Fluent Bit configuration, include it in the main `fluent-bit.conf` file: |
| 59 | + |
| 60 | +```bash |
| 61 | +# Fluent Bit service configuration |
| 62 | +[SERVICE] |
| 63 | + Flush 1 |
| 64 | + Daemon off |
| 65 | + Log_Level debug |
| 66 | + Parsers_File parsers.conf |
| 67 | + HTTP_Server On |
| 68 | + HTTP_Listen 0.0.0.0 |
| 69 | + HTTP_Port 2020 |
| 70 | + Health_Check On |
| 71 | + HTTP_Buffer_Size 1048576 |
| 72 | + |
| 73 | +@include /fluent-bit/etc/logs-evtx.conf |
| 74 | +@include /fluent-bit/etc/logs-auditd.conf |
| 75 | +@include /fluent-bit/etc/logs-json.conf |
| 76 | +@include /fluent-bit/etc/logs-http.conf |
| 77 | +# ==> Add your new configurations below using @include directives |
| 78 | +``` |
| 79 | + |
| 80 | +You do not need to restart the entire stack. Restarting the Fluent Bit service is sufficient: |
| 81 | + |
| 82 | +```bash |
| 83 | +docker compose restart sentinel-kit-server-fluentbit |
| 84 | +``` |
| 85 | + |
| 86 | +## Verifying and Debugging |
| 87 | + |
| 88 | +You can check Fluent Bit logs to confirm that your configuration is working correctly or to debug issues: |
| 89 | + |
| 90 | +```bash |
| 91 | +docker logs -f sentinel-kit-server-fluentbit |
| 92 | +``` |
| 93 | + |
| 94 | +These logs will provide detailed information about configuration loading, parsing, and any encountered errors. |
0 commit comments