我有以下logstash的conf文件:解析XML文件LogStash
input {
file
{
path => "C:\Dashboard\Elmah\*.xml"
start_position => "beginning"
type => "error"
codec => multiline
{
pattern => "^<\?error .*\>"
negate => true
what => "previous"
}
sincedb_path => "C:\Dashboard\Elmah"
}
}
filter
{
xml
{
source => "error"
xpath =>
[
"/error/@errorId", "ErrorId",
"/error/@type", "Type",
"/error/@message", "Message",
"/error/@time", "Time",
"/error/@user", "User"
]
store_xml => true
}
}
output
{
elasticsearch
{
action => "index"
host => "localhost"
index => "stock"
workers => 1
}
stdout
{
codec => rubydebug
}
}
當我運行斌/ logstash -f agent.conf我沒有得到一個錯誤,但沒有數據被插入到Elasticsearch。該文件的一個示例是: https://www.dropbox.com/s/6oni2zhorsdtz6p/error-2015-06-26203423Z-3026bd43-07d6-44d6-a6cf-6d27b28a607e.xml?dl=0
如何讓Logstash讀取外部xml文件的集合?
LogStash調試輸出:
Please see here: https://www.dropbox.com/s/g7g1154uvf9fr1f/outputlog2.txt?dl=0
你從stdout {}的輸出中得到了什麼? –
@AlainCollins:我添加了你請求的信息 –
我的意思是你的logstash stdout(你有一個輸出節引用它)。 –