簡體   English   中英

如何將子json對象轉發到splunk索引器

[英]How to forward sub-json object to splunk indexer

我的應用程序將日志數據寫入磁盤文件。 日志數據為單行json,如下所示。 我使用splunker-forwarder將日志發送到splunk indexer

{“ line”:{“ level”:“ info”,“ message”:“數據正確”,“ timestamp”:“ 2017-08-01T11:35:30.375Z”},“ source”:“ std”}

我只想將子json對象{"level": "info","message": "data is correct","timestamp": "2017-08-01T11:35:30.375Z"}發送給索引器,不是整個json。 我應該如何配置splunk轉發器或splunk索引器?

您可以使用sedcmd刪除索引器將其寫入磁盤之前的數據。

將此添加到您的props.conf

 [Yoursourcetype] #...Other configurations... SEDCMD-removejson = s/(.+)\\:\\{/g 

這是一個索引時間設置,因此您需要重新啟動splunkd才能使更改生效

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM