读取事件的分割,默认是’
’,也就是以一行为一个事件
[elk@node01 conf]$ cat bbbb.txt
555测试1
dsdsdaaaa开发323bb
8888测试iaabb2
33333333aa
[elk@node01 conf]$ cat logstash01.conf
input {
file {
path=>["/home/elk/conf/bbbb.txt"]
type =>"system"
delimiter=>"aaaa"
start_position=>"beginning"
}
}
output {
stdout {
codec => rubydebug
}
}
[elk@node01 conf]$ logstash -f logstash01.conf
Settings: Default pipeline workers: 4
Pipeline main started
{
"message" => "555测试1
dsdsd",
"@version" => "1",
"@timestamp" => "2018-08-01T07:25:29.924Z",
"path" => "/home/elk/conf/bbbb.txt",
"host" => "node01",
"type" => "system"
}
[elk@node01 conf]$ cat dddd.txt
555测试1
dsdsdaaaa开发323bb
8888测试aaaaiaabb2
33333333aa
[elk@node01 conf]$ cat logstash01.conf
input {
file {
path=>["/home/elk/conf/dddd.txt"]
type =>"system"
delimiter=>"aaaa"
start_position=>"beginning"
}
}
output {
stdout {
codec => rubydebug
}
}
[elk@node01 conf]$ logstash -f logstash01.conf
Settings: Default pipeline workers: 4
Pipeline main started
{
"message" => "555测试1
dsdsd",
"@version" => "1",
"@timestamp" => "2018-08-01T07:26:57.794Z",
"path" => "/home/elk/conf/dddd.txt",
"host" => "node01",
"type" => "system"
}
{
"message" => "开发323bb
8888测试",
"@version" => "1",
"@timestamp" => "2018-08-01T07:26:58.007Z",
"path" => "/home/elk/conf/dddd.txt",
"host" => "node01",
"type" => "system"
}