溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Heka同一個文件滾動讀取rolling read FilePollingInput的示例分析

發(fā)布時間:2021-12-16 16:19:34 來源:億速云 閱讀:116 作者:小新 欄目:云計算

這篇文章主要為大家展示了“Heka同一個文件滾動讀取rolling read FilePollingInput的示例分析”,內(nèi)容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“Heka同一個文件滾動讀取rolling read FilePollingInput的示例分析”這篇文章吧。

針對一個文件,周期性質(zhì)的去讀取內(nèi)容,無buffer的讀取,典型應(yīng)用

1,內(nèi)存使用情況讀取

[hekad]
maxprocs = 2

[MemStats]
type = "FilePollingInput"
ticker_interval = 1
file_path = "/proc/meminfo"
decoder = "MemStatsDecoder"


[MemStatsDecoder]
type = "SandboxDecoder"
filename = "lua_decoders/linux_memstats.lua"


[RstEncoder]

[LogOutput]
message_matcher = "TRUE"
encoder = "RstEncoder"

結(jié)果如下,

:Timestamp: 2016-07-22 10:29:48 +0000 UTC
:Type: stats.memstats
:Hostname: master
:Pid: 0
:Uuid: 977fd381-43d8-424a-a410-8d230b85ab46
:Logger: MemStats
:Payload: 
:EnvVersion: 
:Severity: 7
:Fields:
    | name:"Hugepagesize" type:double value:2048 representation:"kB"
    | name:"Buffers" type:double value:183108 representation:"kB"
    | name:"Active" type:double value:696196 representation:"kB"
    | name:"Bounce" type:double value:0 representation:"kB"
    | name:"SUnreclaim" type:double value:31416 representation:"kB"
    | name:"HugePages_Total" type:double value:0
    | name:"Active(anon)" type:double value:454064 representation:"kB"
    | name:"Mlocked" type:double value:0 representation:"kB"
    | name:"AnonPages" type:double value:981512 representation:"kB"
    | name:"Active(file)" type:double value:242132 representation:"kB"
    | name:"Committed_AS" type:double value:3.152928e+06 representation:"kB"
    | name:"VmallocUsed" type:double value:149148 representation:"kB"
    | name:"SwapFree" type:double value:2.009828e+06 representation:"kB"
    | name:"Inactive(file)" type:double value:313540 representation:"kB"
    | name:"CommitLimit" type:double value:2.988856e+06 representation:"kB"
    | name:"Slab" type:double value:164308 representation:"kB"
    | name:"PageTables" type:double value:16888 representation:"kB"
    | name:"HugePages_Free" type:double value:0
    | name:"SwapTotal" type:double value:2.031608e+06 representation:"kB"
    | name:"NFS_Unstable" type:double value:0 representation:"kB"
    | name:"VmallocChunk" type:double value:3.4359583224e+10 representation:"kB"
    | name:"HugePages_Surp" type:double value:0
    | name:"DirectMap1G" type:double value:0 representation:"kB"
    | name:"DirectMap2M" type:double value:2.091008e+06 representation:"kB"
    | name:"DirectMap4k" type:double value:6144 representation:"kB"
    | name:"HugePages_Rsvd" type:double value:0
    | name:"Shmem" type:double value:1164 representation:"kB"
    | name:"SReclaimable" type:double value:132892 representation:"kB"
    | name:"Mapped" type:double value:57724 representation:"kB"
    | name:"HardwareCorrupted" type:double value:0 representation:"kB"
    | name:"FilePath" type:string value:"/proc/meminfo"
    | name:"MemFree" type:double value:159100 representation:"kB"
    | name:"Writeback" type:double value:0 representation:"kB"
    | name:"SwapCached" type:double value:3240 representation:"kB"
    | name:"WritebackTmp" type:double value:0 representation:"kB"
    | name:"Dirty" type:double value:164 representation:"kB"
    | name:"VmallocTotal" type:double value:3.4359738367e+10 representation:"kB"
    | name:"Inactive" type:double value:844780 representation:"kB"
    | name:"AnonHugePages" type:double value:706560 representation:"kB"
    | name:"Unevictable" type:double value:0 representation:"kB"
    | name:"Inactive(anon)" type:double value:531240 representation:"kB"
    | name:"KernelStack" type:double value:3128 representation:"kB"
    | name:"Cached" type:double value:373728 representation:"kB"
    | name:"MemTotal" type:double value:1.914496e+06 representation:"kB"

fileds中的值會隨著每次讀取發(fā)生變化的。

應(yīng)用二,系統(tǒng)負載讀取

[LoadAvg]
type = "FilePollingInput"
ticker_interval = 1
file_path = "/proc/loadavg"
decoder = "LoadAvgDecoder"

[LoadAvgDecoder]
type = "SandboxDecoder"
filename = "lua_decoders/linux_loadavg.lua"

應(yīng)用三,磁盤情況讀取

[DiskStats]
type = "FilePollingInput"
ticker_interval = 1
file_path = "/sys/block/sda1/stat"
decoder = "DiskStatsDecoder"

[DiskStatsDecoder]
type = "SandboxDecoder"
filename = "lua_decoders/linux_diskstats.lua"

應(yīng)用四,cpu情況讀取

[ProcStats]
type = "FilePollingInput"
ticker_interval = 1
file_path = "/proc/stat"
decoder = "ProcStatDecoder"

[ProcStatDecoder]
type = "SandboxDecoder"
filename = "lua_decoders/linux_procstat.lua"

應(yīng)用五,設(shè)備情況讀取

[Netdev]
type = "FilePollingInput"
ticker_interval = 1
file_path = "/proc/net/dev"
decoder = "NetdevDecoder"

[NetdevDecoder]
type = "SandboxDecoder"
filename = "lua_decoders/linux_netdev.lua"

應(yīng)用六,網(wǎng)絡(luò)情況讀取

[NetNetstat]
type = "FilePollingInput"
ticker_interval = 1
file_path = "/proc/net/netstat"
decoder = "NetstatDecoder"

[NetSnmp]
type = "FilePollingInput"
ticker_interval = 1
file_path = "/proc/net/snmp"
decoder = "NetstatDecoder"

[NetstatDecoder]
type = "SandboxDecoder"
filename = "lua_decoders/linux_netstat.lua"

以上是“Heka同一個文件滾動讀取rolling read FilePollingInput的示例分析”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI