使用Logstash CSV过滤器不工作 [英] Use Logstash CSV filter doesn't work
问题描述
我试图在Logstash上使用CSV过滤器,但它可以上传我的文件的值。
我使用Ubuntu Server 14.04,kibana 4,logstash 1.4.2和elasticsearch 1.4.4。
接下来显示我写的CSV文件和过滤器。我做错了什么?
CSV档案:
Joao,21,555
Miguel,24,1000
Rodrigo,43,443
Maria,54,2343
Antonia,67,213
Logstash CSV过滤器:
#Este e filtro que le o ficheiro e permite alocar os dados num index do Elasticsearch
input
{
file
{
path => [/opt/logstash/bin/testeFile_lite.csv]
start_position => beginning
#sincedb_path => NIL
}
}
filter
{
csv
{
columns => [nome,idade,salario]
separator => ,
}
}
输出
{
elasticsearch
{
action => index
host => localhost
index => logstash - %{+ YYYY.MM.dd}
}
stdout
{
codec => rubydebug
}
}
当我执行过滤器,出现:使用里程碑2输入插件'文件'...和使用里程碑2输入插件'csv'...和OK消息不出现。
有人可以帮我吗?
我解决了这个问题在输入文件中添加字段sincedb_path。 p>
这是Logstash CSV过滤器:
input
{
文件
{
path => /opt/logstash/bin/testeFile_lite.csv
type => testeFile_lite
start_position => beginning
sincedb_path => / opt / logstash / bin / dbteste
}
}
filter
{
csv
{
columns => ['nome','idade','salario']
separator => ,
}
}
输出
{
elasticsearch
{
action => index
host => localhost
index => xpto
cluster => SIC_UTAD
}
stdout
{
codec => rubydebug
}
}
I was trying to use CSV filter on Logstash but it can upload values of my file. I'm using Ubuntu Server 14.04, kibana 4, logstash 1.4.2 and elasticsearch 1.4.4. Next I show my CSV file and filter I wrote. Am I doing something wrong?
CSV File:
Joao,21,555
Miguel,24,1000
Rodrigo,43,443
Maria,54,2343
Antonia,67,213
Logstash CSV filter:
#Este e filtro que le o ficheiro e permite alocar os dados num index do Elasticsearch
input
{
file
{
path => ["/opt/logstash/bin/testeFile_lite.csv"]
start_position => "beginning"
# sincedb_path => "NIL"
}
}
filter
{
csv
{
columns => ["nome", "idade", "salario"]
separator => ","
}
}
output
{
elasticsearch
{
action => "index"
host => "localhost"
index => "logstash-%{+YYYY.MM.dd}"
}
stdout
{
codec => rubydebug
}
}
When I execute filter, appears: using milestone 2 input plugin 'file'... and using milestone 2 input plugin 'csv'... and the OK message doesn't appear.
Someone can help me?
I solved the problem adding the field sincedb_path in the input file.
Here's the Logstash CSV filter:
input
{
file
{
path => "/opt/logstash/bin/testeFile_lite.csv"
type => "testeFile_lite"
start_position => "beginning"
sincedb_path => "/opt/logstash/bin/dbteste"
}
}
filter
{
csv
{
columns => ['nome', 'idade', 'salario']
separator => ","
}
}
output
{
elasticsearch
{
action => "index"
host => "localhost"
index => "xpto"
cluster => "SIC_UTAD"
}
stdout
{
codec => rubydebug
}
}
这篇关于使用Logstash CSV过滤器不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!