我需要检测U盘是否插入metricbeat或filebeat以将此报告给elasticsearch服务器。我需要这两个windows和linux。有什么想法吗?
kmbjn2e31#
使用filebeat,只需指定 log 输入usb磁盘卷的路径:
log
- type: log # Change to true to enable this input configuration. enabled: true # Paths that should be crawled and fetched. Glob based paths. paths: # On Mac - /Volumes/MY_USB_DISK/*.* # On Linux - /mnt/usb/*.* # On Windows (pick the right drive letter on which the USB disk is mounted) - F:\*.* fields: source: usb
- type: log
# Change to true to enable this input configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
# On Mac
- /Volumes/MY_USB_DISK/*.*
# On Linux
- /mnt/usb/*.*
# On Windows (pick the right drive letter on which the USB disk is mounted)
- F:\*.*
fields:
source: usb
然后你可以启动filebeat,一旦usb盘被插入,filebeat就会开始跟踪与上面路径匹配的所有文件,并将它们发送到es。
1条答案
按热度按时间kmbjn2e31#
使用filebeat,只需指定
log
输入usb磁盘卷的路径:然后你可以启动filebeat,一旦usb盘被插入,filebeat就会开始跟踪与上面路径匹配的所有文件,并将它们发送到es。