十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
配置文件的基本格式,输入部分,过滤器部分和输出部分。

# This is a comment. You should use comments to describe
# parts of your configuration.
input {
...
}
filter {
...
}
output {
...
}每个部分都可以配置一个或多个插件。下面展示的是输入部分,有两个file插件。
input {
file {
path => "/var/log/messages"
type => "syslog"
}
file {
path => "/var/log/apache/access.log"
type => "apache"
}
}插件的值类型
数组
path => [ "/var/log/messages", "/var/log/*.log" ] path => "/data/mysql/mysql.log"
布尔
ssl_enable => true
字符串
name => "Hello world" name => 'It\'s a beautiful day'
哈希
match => {
"field1" => "value1"
"field2" => "value2"
...
}字节
my_bytes => "1113" # 1113 bytes my_bytes => "10MiB" # 10485760 bytes my_bytes => "100kib" # 102400 bytes my_bytes => "180 mb" # 180000000 bytes
代码
codec => "json"
数值:浮点或整型
port => 33
密码型:不会记录到日志或打印出来
my_password => "password"
路径型:字符串
my_path => "/tmp/logstash"
注释:使用#
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。