我已按此配置
$this->form_validation->set_rules('what_licence', 'What licence', 'required');
$this->form_validation->set_rules('initials', 'Initials', 'trim|required|alpha');
$this->form_validation->set_rules('lastname', 'Last Name', 'trim|required|alpha|min_length[3]|max_length[30]');
$this->form_validation->set_rules('email', 'Email ID', 'trim|required|valid_email|is_unique[yourself.email]');
$this->form_validation->set_rules('tel_number', 'Phone Number', 'required|numeric|min_length[9]|callback_uk_phone_check');
$this->form_validation->set_rules('address', 'Address', 'trim|required|alpha_numeric_spaces');
$this->form_validation->set_rules('post-code', 'Post Code', 'trim|required|alpha_numeric_spaces');
$data = array(
'what_licence' => $this->input->post('what_licence'),
'initials' => $this->input->post('initials'),
'lastname' => $this->input->post('lastname'),
'email' => $this->input->post('email'),
'tel_number' => $this->input->post('tel_number'),
'address' => $this->input->post('address'),
'post-code' => $this->input->post('post-code'),
);
当我使用input {
file {
path => "/opt/data/user-*.json"
type => "json"
start_position => "beginning"
sincedb_path => "/dev/null"
tags => ["user"]
}
}
filter {
json {
source => "message"
}
}
output {
stdout { codec => rubydebug }
}
运行logstash时,它显示没有任何输出的消息,似乎它一直在等待消耗新内容(但我已经设置--debug
)
sincedb_path => "/dev/null"
当我将输入更改为stdin并将json粘贴到我的数据文件中时,就可以了。
_globbed_files: /opt/data/user-*.json: glob is: ["/opt/data/user-2016-08-08.json"] {:level=>:debug, :file=>"filewatch/watch.rb", :line=>"346", :method=>"_globbed_files"}
Pushing flush onto pipeline {:level=>:debug, :file=>"logstash/pipeline.rb", :line=>"458", :method=>"flush"}
Pushing flush onto pipeline {:level=>:debug, :file=>"logstash/pipeline.rb", :line=>"458", :method=>"flush"}