당신의 도움이 필요합니다. elasticsearch
클러스터에 내 로그를 보내려면 tail 모드에서 fluentd
을 구성해야합니다. 각 로그 라인을 구문 분석하기 위해 regex
을 사용하고 있지만 일부 필드의 경우 metricValue
을 integer
으로 변환해야합니다. 나는 몇 가지 시도했지만 작동하지 않습니다. 여기 fluentd 필드를 정수로 변환하십시오.
<source>
@type tail
path /tmp/application.log
pos_file /tmp/access.log.pos
format multi_format
tag first.log
<pattern>
format /(?<app>.*)\((?<instance>.*)\) CID\((?<correlationId>.*)\) (?<level>.*) \[(?<timestamp>.*)\] \[(?<Thread>.*)\] (?<class>.*) - \[Provider:(?<providerName>.*),Curef:(?<cuRef>.*),Operation:(?<operation>.*),Reference:(?<reference>.*),Idx:(?<idx>.*)\]/
</pattern>
<pattern>
format /(?<app>.*)\((?<instance>.*)\) CID\((?<correlationId>.*)\) (?<level>.*) \[(?<timestamp>.*)\] \[(?<Thread>.*)\] (?<class>.*) - (?<body>.*)/
</pattern>
</source>
<match *.log>
@type copy
<store>
@type stdout
</store>
<store>
@type elasticsearch
host localhost
port 9200
logstash_format true
logstash_prefix fluentd-log
flush_interval 10s
</store>
</match>
내가 fluend 문서 구문에서 찾을 수 있지만 작동하지 않습니다 (그리고 나는이 줄을 추가 할 위치를 모르는)
types <field_name_1>:<type_name_1>,<field_name_2>:<type_name_2>,...
elasticsearch
으로 보내기 전에 metricValue 필드를 정수로 변환하고 싶습니다.
아무쪼록 감사드립니다.
C.C.