I have the following message log:--
{"log":{"Prefix":"NXFILTER","Time":"2020-05-29 19:30:43","Blocked":"N","Domain":"qwert.com","User":"10.8184882","ClientIp":"0.0.0.0","Policy":"Teste","Category":"Download","Reason":"","Type":1,"Group":"test"}}But I want that result to be just the content inside the "log" parent, e.g:
{"Prefix":"NXFILTER","Time":"2020-05-29 19:30:43","Blocked":"N","Domain":"qwert.com","User":"10.8184882","ClientIp":"0.0.0.0","Policy":"Teste","Category":"Download","Reason":"","Type":1,"Group":"test"}
Any idea?
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fluentd/6a0791e4-1805-4e71-9e94-ac1d412c952co%40googlegroups.com.
<match fluent.**>
@type null
</match>
<source>
@type tail
@id in_tail_abc_container_logs_dd
path "/var/log/containers/abc-*.log"
pos_file "/var/log/abc-fluentd-containers-dd.pos"
tag "datadog"
read_from_head true
emit_unmatched_lines false
<parse>
@type "json"
time_format "%Y-%m-%dT%H:%M:%S.%NZ"
unmatched_lines false
time_type string
</parse>
</source>
<source>
@type tail
@id in_tail_abc_container_logs_es
path "/var/log/containers/abc-*.log"
pos_file "/var/log/abc-fluentd-containers-es.pos"
tag "es"
read_from_head true
emit_unmatched_lines false
<parse>
@type "json"
time_format "%Y-%m-%dT%H:%M:%S.%NZ"
unmatched_lines false
time_type string
</parse>
</source>
<filter datadog.**>
@type grep
<regexp>
key "log"
pattern /(\s|^|[[:punct:]])(error|fail|failed|critical|fatal)/i
</regexp>
</filter>
<filter es>
@type map
time "time"
record "(record[\"log\"])"
</filter>
<match datadog.**>
@type datadog
@id abc_datadog_agent
api_key xxxxxx
<buffer>
@type "memory"
flush_thread_count 4
flush_interval 3s
chunk_limit_size 5m
chunk_limit_records 500
</buffer>
</match>
<match es.**>
@type aws-elasticsearch-service
type_name "access_log"
logstash_format true
include_tag_key true
tag_key "@log_name"
flush_interval 1s
logstash_prefix "abcdev"
<endpoint>
url "https://vpc-abc-application-logsxxxxxxxxxxxx.es.amazonaws.com"
region "us-east-1"
access_key_id "xxxxxxx"
secret_access_key xxxxxx
</endpoint>
<buffer>
flush_interval 1s
</buffer>
</match>
How about using fluent-plugin-map like below?<filter test.**>
@type map
time time
record (record["log"])
</filter>
On Tue, Jun 9, 2020 at 4:46 AM Leonardo Fuzeto <leonard...@wspot.com.br> wrote:
I have the following message log:--
{"log":{"Prefix":"NXFILTER","Time":"2020-05-29 19:30:43","Blocked":"N","Domain":"qwert.com","User":"10.8184882","ClientIp":"0.0.0.0","Policy":"Teste","Category":"Download","Reason":"","Type":1,"Group":"test"}}But I want that result to be just the content inside the "log" parent, e.g:
{"Prefix":"NXFILTER","Time":"2020-05-29 19:30:43","Blocked":"N","Domain":"qwert.com","User":"10.8184882","ClientIp":"0.0.0.0","Policy":"Teste","Category":"Download","Reason":"","Type":1,"Group":"test"}
Any idea?
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flu...@googlegroups.com.