Using an OpenSearch Ingestion pipeline with Fluent Bit
This sample Fluent
Bit configuration file
Note the following:
-
The
hostvalue must be your pipeline endpoint. For example,.pipeline-endpoint.us-east-1osis.amazonaws.com -
The
aws_servicevalue must beosis. -
The
aws_role_arnvalue is the ARN of the AWS IAM role for the client to assume and use for Signature Version 4 authentication.
[INPUT] name tail refresh_interval 5 path /var/log/test.log read_from_head true [OUTPUT] Name http Match * Hostpipeline-endpoint.us-east-1osis.amazonaws.com Port 443 URI /log/ingest Format json aws_auth true aws_regionregionaws_service osis aws_role_arn arn:aws:iam::account-id:role/ingestion-roleLog_Level trace tls On
You can then configure an OpenSearch Ingestion pipeline like the following, which has HTTP as the source:
version: "2" unaggregated-log-pipeline: source: http: path: "/log/ingest" processor: - grok: match: log: - "%{TIMESTAMP_ISO8601:timestamp} %{NOTSPACE:network_node} %{NOTSPACE:network_host} %{IPORHOST:source_ip}:%{NUMBER:source_port:int} -> %{IPORHOST:destination_ip}:%{NUMBER:destination_port:int} %{GREEDYDATA:details}" - grok: match: details: - "'%{NOTSPACE:http_method} %{NOTSPACE:http_uri}' %{NOTSPACE:protocol}" - "TLS%{NOTSPACE:tls_version} %{GREEDYDATA:encryption}" - "%{NUMBER:status_code:int} %{NUMBER:response_size:int}" - delete_entries: with_keys: ["details", "log"] sink: - opensearch: hosts: ["https://search-domain-endpoint.us-east-1es.amazonaws.com"] index: "index_name" index_type: custom bulk_size: 20 aws: region: "region"