Fluentd does not parse nested sting to json

31 views
Skip to first unread message

BOB BOB

unread,
Jul 1, 2021, 12:56:50 AM7/1/21
to Fluentd Google Group
I have the following json message on Fluentd input
2021-06-24 10:38:28.501 -       EventInfo {"id":"141513403237795328","entity":"EventInfo","command":"update","paramFloat2":1,"typeId":"1","eventId":"141166340827303936","providerId":"3000979","statusId":"1","eventPartId":"40","paramFloat1":2,"paramParticipantId1":"37426","paramParticipantId2":"37433"}

And want to get the output message
i want convert JSON Type
PLEASE HELP ME

{"reg_time":"2021-06-24 10:38:28.501","id":"141513403237795328","entity":"EventInfo","command":"update","paramFloat2":1,"typeId":"1","eventId":"141166340827303936","providerId":"3000979","statusId":"1","eventPartId":"40","paramFloat1":2,"paramParticipantId1":"37426","paramParticipantId2":"37433"}

<source>
@type tail

format /^(?<reg_date>[^\-].+?\s.+?.[0-9].[0-9]+\.[0-9]+).+?\s.+?id.+?\:\s\'(?<id>[^\']+).+?entity.+?\'(?<entity>EventInfo).+?command.+?\'(?<command>[^\']+).+?version.+?(?<version>\d+).+?typeId.+?(?<typeid>1).+?eventId.+?\'(?<eventid>\d+).+?providerId.+?(?<providerid>\d+).+?statusId.+?(?<statusid>\d+).+?eventPartId.+?(?<eventpartid>\d+).+?paramFloat1.+?(?<paramfloat1>\d+).+?paramFloat2.+?(?<paramfloat2>\d+).+?paramParticipantId1.+?(?<paramparticipantid1>\d+).+?paramParticipantId2.+?(?<paramparticipantid2>\d+)/

path C:/Users/GG/Desktop/jetbull_LOG/log_file/log-legacy*.log
pos_file C:/Users/GG/Desktop/jetbull_LOG/log_file/test.pos

tag log-leagcy.*
refresh_interval 1
open_on_every_update true
</source>






<match log-leagcy.**>
@type mysql_bulk
host localhost
database jet_bull
username root
password autoset
column_names reg_date,id,entity,command,version,typeid,eventid,providerid,statusid,eventpartid,paramfloat1,paramfloat2,paramparticipantid1,paramparticipantid2
key_names reg_date,id,entity,command,version,typeid,eventid,providerid,statusid,eventpartid,paramfloat1,paramfloat2,paramparticipantid1,paramparticipantid2
table tb_live
flush_interval 1s
</match>


Reply all
Reply to author
Forward
0 new messages