您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“Heka同一個文件滾動讀取rolling read FilePollingInput的示例分析”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“Heka同一個文件滾動讀取rolling read FilePollingInput的示例分析”這篇文章吧。
針對一個文件,周期性質的去讀取內容,無buffer的讀取,典型應用
1,內存使用情況讀取
[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"
結果如下,
: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中的值會隨著每次讀取發生變化的。
應用二,系統負載讀取
[LoadAvg] type = "FilePollingInput" ticker_interval = 1 file_path = "/proc/loadavg" decoder = "LoadAvgDecoder" [LoadAvgDecoder] type = "SandboxDecoder" filename = "lua_decoders/linux_loadavg.lua"
應用三,磁盤情況讀取
[DiskStats] type = "FilePollingInput" ticker_interval = 1 file_path = "/sys/block/sda1/stat" decoder = "DiskStatsDecoder" [DiskStatsDecoder] type = "SandboxDecoder" filename = "lua_decoders/linux_diskstats.lua"
應用四,cpu情況讀取
[ProcStats] type = "FilePollingInput" ticker_interval = 1 file_path = "/proc/stat" decoder = "ProcStatDecoder" [ProcStatDecoder] type = "SandboxDecoder" filename = "lua_decoders/linux_procstat.lua"
應用五,設備情況讀取
[Netdev] type = "FilePollingInput" ticker_interval = 1 file_path = "/proc/net/dev" decoder = "NetdevDecoder" [NetdevDecoder] type = "SandboxDecoder" filename = "lua_decoders/linux_netdev.lua"
應用六,網絡情況讀取
[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的示例分析”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。