[INPUT] name tail Tag node_metrics path /docker-logs/*.log path_key path multiline.parser docker, cri Parser docker Docker_Mode On
[SERVICE] Flush 1 Parsers_File parsers.conf
[OUTPUT] Name influxdb Match * Host 호스트주소 Port 8086 Bucket 버킷명 Org 조직아이디 0232313aaaa HTTP_Token influxdb 토큰
OUTPUT influxDB에 던지는 방법이다.
서버에 대한 부하도 굉장히 적다.
parsers.conf
[PARSER] Name springboot Format regex Regex (?<time>\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}.\d{1,3}) (?<level>[^ ]*) (?<number>\d*) --- (?<thread>\[[^ ]*) (?<logger>[^ ]*) *: (?<message>[^ ].*)$ Time_Key time Time_Format %Y-%m-%d %H:%M:%S.%L
[PARSER] Name docker Format json Time_Key time Time_Format %Y-%m-%dT%H:%M:%S.%L Time_Keep On # Command | Decoder | Field | Optional Action # =============|==================|================= Decode_Field_As escaped log
[MULTILINE_PARSER] name multiline-regex-test type regex flush_timeout 1000 # # Regex rules for multiline parsing # --------------------------------- # # configuration hints: # # - first state always has the name: start_state # - every field in the rule must be inside double quotes # # rules | state name | regex pattern | next state # ------|---------------|-------------------------------------------- rule "start_state" "/([a-zA-Z]+ \d+ \d+\:\d+\:\d+)(.*)/" "cont" rule "cont" "/^\s+at.*/" "cont"
[PARSER] Name named-capture-test Format regex Regex /^(?<date>[a-zA-Z]+ \d+ \d+\:\d+\:\d+) (?<message>.*)/m