如何检测U盘是否插入metricbeat或filebeat?

m1m5dgzv  于 2021-06-15  发布在  ElasticSearch
关注(0)|答案(1)|浏览(493)

我需要检测U盘是否插入metricbeat或filebeat以将此报告给elasticsearch服务器。
我需要这两个windows和linux。有什么想法吗?

kmbjn2e3

kmbjn2e31#

使用filebeat,只需指定 log 输入usb磁盘卷的路径:

  1. - type: log
  2. # Change to true to enable this input configuration.
  3. enabled: true
  4. # Paths that should be crawled and fetched. Glob based paths.
  5. paths:
  6. # On Mac
  7. - /Volumes/MY_USB_DISK/*.*
  8. # On Linux
  9. - /mnt/usb/*.*
  10. # On Windows (pick the right drive letter on which the USB disk is mounted)
  11. - F:\*.*
  12. fields:
  13. source: usb

然后你可以启动filebeat,一旦usb盘被插入,filebeat就会开始跟踪与上面路径匹配的所有文件,并将它们发送到es。

展开查看全部

相关问题