Kafka 콘솔 소비자를 사용할 때 이스케이프 문자를 제거하는 방법은 무엇입니까?

Kafka 콘솔 소비자를 사용할 때 이스케이프 문자를 제거하는 방법은 무엇입니까?

규정 준수를 위해 모든 kafka 원시 문서를 저장하고 1년 동안 보관해야 합니다. 이를 위해 다음을 사용합니다.

kafka-console-consumer.sh --bootstrap-server kafka1:9092,kafka2:9092,kafka3:9092 --topic test1 --consumer.config /usr/local/kafka_2.12-2.2.1/config/consumer.properties >> /데이터/backup.txt

저장된 문서에는 다음과 같은 이스케이프 문자가 있습니다(각 큰따옴표 앞의 \).

{"type":"Fortigate","@timestamp":"2021-09-06T09:20:38.909Z","message":"<189>date=2021-09-06 time=11:20:38 devname=\"FW_N\" devid=\"FG1123\" logid=\"0000000013\" type=\"traffic\" subtype=\"forward\" level=\"notice\" vd=\"FW-D\" eventtime=1630920038 srcip=1.2.3.4 srcport=59349 srcintf=\"LAG11.2418\" srcintfrole=\"undefined\" dstip=1.2.3.4 dstport=8531 dstintf=\"LAG11.1470\" dstintfrole=\"undefined\" poluuid=\"8f80acf4-db3f-51eb-369f-97e43f065438\" sessionid=3122225826 proto=6 action=\"deny\" policyid=1234 policytype=\"policy\" service=\"gTCP/8531\" dstcountry=\"Reserved\" srccountry=\"Reserved\" trandisp=\"noop\" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 appcat=\"unscanned\" crscore=30 craction=131072 crlevel=\"high\"","@version":"1","host":"5.6.7.8"}

예상 결과 :

{"type":"Fortigate","@timestamp":"2021-09-06T09:20:38.909Z","message":"<189>date=2021-09-06 time=11:20:38 devname="FW_N" devid="FG1123" logid="0000000013" type="traffic" subtype="forward" level="notice" vd="FW-D" eventtime=1630920038 srcip=1.2.3.4 srcport=59349 srcintf="LAG11.2418" srcintfrole="undefined" dstip=1.2.3.4 dstport=8531 dstintf="LAG11.1470" dstintfrole="undefined" poluuid="8f80acf4-db3f-51eb-369f-97e43f065438" sessionid=3122225826 proto=6 action="deny" policyid=1234 policytype="policy" service="gTCP/8531" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 appcat="unscanned" crscore=30 craction=131072 crlevel="high"","@version":"1","host":"5.6.7.8"}

이러한 이스케이프 문자를 추가하지 않도록 kafka 콘솔 소비자에게 알릴 수 있는 방법이 있습니까?

관련 정보