From e2359d5dda53c5f325316de153a829468d6ebe3a Mon Sep 17 00:00:00 2001 From: YANGDB Date: Fri, 26 May 2023 14:06:53 -0700 Subject: [PATCH] Update README.md update fluent-bit README.md file reference to the config Signed-off-by: YANGDB --- src/fluent-bit/README.md | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/fluent-bit/README.md b/src/fluent-bit/README.md index 52f7ef4a52..ef7371b223 100644 --- a/src/fluent-bit/README.md +++ b/src/fluent-bit/README.md @@ -19,35 +19,8 @@ For setting up a fluent-bit agent on Nginx, please follow the next instructions - Install Fluent-bit on the Nginx server. You can download the latest package from the official Fluent-bit website or use your package manager to install it. -- Once Fluent-bit is installed, create a configuration file named fluent-bit.conf in the /etc/fluent-bit/ directory. Add the following configuration to the file: +- Once Fluent-bit is installed, create a configuration file named [fluent-bit.conf](fluent-bit.conf) in the /etc/fluent-bit/ directory. Add the following configuration to the file: -```text -[SERVICE] - Flush 1 - Log_Level info - Parsers_File parsers.conf - -[Filter] - Name lua - Match * - code function cb_filter(a,b,c)local d={}local e=os.date("!%Y-%m-%dT%H:%M:%S.000Z")d["observerTime"]=e;d["body"]=c.remote.." "..c.host.." "..c.user.." ["..os.date("%d/%b/%Y:%H:%M:%S %z").."] \""..c.method.." "..c.path.." HTTP/1.1\" "..c.code.." "..c.size.." \""..c.referer.."\" \""..c.agent.."\""d["trace_id"]="102981ABCD2901"d["span_id"]="abcdef1010"d["attributes"]={}d["attributes"]["data_stream"]={}d["attributes"]["data_stream"]["dataset"]="nginx.access"d["attributes"]["data_stream"]["namespace"]="production"d["attributes"]["data_stream"]["type"]="logs"d["event"]={}d["event"]["category"]={"web"}d["event"]["name"]="access"d["event"]["domain"]="nginx.access"d["event"]["kind"]="event"d["event"]["result"]="success"d["event"]["type"]={"access"}d["http"]={}d["http"]["request"]={}d["http"]["request"]["method"]=c.method;d["http"]["response"]={}d["http"]["response"]["bytes"]=tonumber(c.size)d["http"]["response"]["status_code"]=c.code;d["http"]["flavor"]="1.1"d["http"]["url"]=c.path;d["communication"]={}d["communication"]["source"]={}d["communication"]["source"]["address"]="127.0.0.1"d["communication"]["source"]["ip"]=c.remote;return 1,b,d end - call cb_filter - -[INPUT] - Name tail - Path /var/log/nginx/access.log - Tag nginx.access - DB /var/log/flb_input.access.db - Mem_Buf_Limit 5MB - Skip_Long_Lines On - -[OUTPUT] - Name opensearch - Match nginx.* - Host - Port - Index sso_nginx-access-%Y.%m.%d -``` Here, we specify the input plugin as tail, set the path to the Nginx access log file, and specify a tag to identify the logs in Fluent-bit. We also set some additional parameters such as memory buffer limit and skipping long lines. For the output, we use the `opensearch` plugin to send the logs to Opensearch. We specify the Opensearch host, port, and index name. @@ -62,4 +35,4 @@ sudo systemctl start fluent-bit - Verify that Fluent-bit is running by checking its status: ```text sudo systemctl status fluent-bit -``` \ No newline at end of file +```