Update fluentbit

This commit is contained in:
2022-04-05 15:27:52 +10:00
parent a85885a058
commit 829867c30c
2 changed files with 44 additions and 3 deletions
+38 -3
View File
@@ -193,6 +193,14 @@ config:
## https://docs.fluentbit.io/manual/pipeline/inputs ## https://docs.fluentbit.io/manual/pipeline/inputs
inputs: | inputs: |
[INPUT]
Name tail
Path /var/log/containers/ingress-nginx-ingress-controller-*.log
Parser docker
Tag nginx-ingress.*
Mem_Buf_Limit 4Mb
Skip_Long_Lines Off
[INPUT] [INPUT]
Name tail Name tail
Path /var/log/containers/*.log Path /var/log/containers/*.log
@@ -230,6 +238,16 @@ config:
# } # }
# } # }
filters: | filters: |
[FILTER]
Name kubernetes
Match nginx-ingress.*
Buffer_Size 128KB
Merge_Parser k8s-nginx-ingress
Merge_Log On
Keep_Log Off
K8S-Logging.Parser On
K8S-Logging.Exclude On
[FILTER] [FILTER]
Name kubernetes Name kubernetes
Match kube.* Match kube.*
@@ -238,10 +256,11 @@ config:
Keep_Log Off Keep_Log Off
K8S-Logging.Parser On K8S-Logging.Parser On
K8S-Logging.Exclude On K8S-Logging.Exclude On
## filter order matteres ## filter order matteres
[FILTER] [FILTER]
Name geoip2 Name geoip2
Match kube.* Match nginx-ingress.*
Database /mnt/GeoLite2-City.mmdb Database /mnt/GeoLite2-City.mmdb
Lookup_key host Lookup_key host
Record city host %{city.names.en} Record city host %{city.names.en}
@@ -251,11 +270,27 @@ config:
Record country_name host %{country.names.en} Record country_name host %{country.names.en}
# Record postal_code host %{postal.code} # Record postal_code host %{postal.code}
Record region_code host %{subdivisions.0.iso_code} Record region_code host %{subdivisions.0.iso_code}
# Record region_name host %{subdivisions.0.names.en} Record region_name host %{subdivisions.0.names.en}
[FILTER]
Name lua
Match nginx-ingress.*
script /mnt/generate-location.lua
call generate_location
## https://docs.fluentbit.io/manual/pipeline/outputs ## https://docs.fluentbit.io/manual/pipeline/outputs
outputs: | outputs: |
[OUTPUT]
Name es
Match nginx-ingress.*
Host elasticsearch.es.svc.cluster.local
Port 9200
Index geo-nginx-ingress.%Y
Retry_Limit 10
Buffer_Size 1024KB
Trace_Error On
Replace_Dots On
Suppress_Type_Name On
[OUTPUT] [OUTPUT]
Name es Name es
Match kube.* Match kube.*
+6
View File
@@ -0,0 +1,6 @@
function generate_location(tag, timestamp, record)
if record["latitude"] ~= nil then
record["location"] = record["latitude"] .. "," .. record["longitude"]
end
return 2, timestamp, record
end