I did some research and tried the below with a multiline:
input {
http_poller {
urls => {
url => "https://appd.com/controller/virtual%20Response%20Time%20%28ms%29&time-range-type=BEFORE_NOW&duration-in-mins=5"
}
truststore => "path/to/cacerts.jks"
truststore_password => "*****"
request_timeout => 60
user => "*****"
password => "****"
metadata_target => "http_poller_metadata"
schedule => { cron => "* * * * * UTC"}
codec => multiline {
pattern => "<metric-datas>"
negate => "true"
what => "previous"
}
}
}
filter
{
xml {
source => "message"
target => "xmldata"
store_xml => "true"
xpath => [
"/metric-datas/metric-data/metricID/text()", "metricID",
"/metric-datas/metric-data/metricName/text()", "metricName",
"/metric-datas/metric-data/metricPath/text()", "metricPath",
"/metric-datas/metric-data/frequency/text()", "Frequency",
"/metric-datas/metric-data/metricValues/metric-value/startTimeInMillis/text()", "starttime",
"/metric-datas/metric-data/metricValues/metric-value/occurences/text()", "occurences",
"/metric-datas/metric-data/metricValues/metric-value/current/text()", "current",
"/metric-datas/metric-data/metricValues/metric-value/min/text()", "min",
"/metric-datas/metric-data/metricValues/metric-value/max/text()", "max",
"/metric-datas/metric-data/metricValues/metric-value/useRange/text()", "UseRange",
"/metric-datas/metric-data/metricValues/metric-value/count/text()", "count",
"/metric-datas/metric-data/metricValues/metric-value/sum/text()", "sum",
"/metric-datas/metric-data/metricValues/metric-value/value/text()", "value",
"/metric-datas/metric-data/metricValues/metric-value/standardDeviation/text()", "SatndardDeviation",
]
}
}
which is giving me an error:
`
[2020-02-26T07:38:23,938][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:appd, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, ", ', -, [, { at line 42, column 9 (byte 2006) after filter\n{\nxml {\n source => "message"\n\t\ttarget => "xmldata"\n store_xml => "true"\nxpath => [\n "/metric-datas/metric-data/metricID/text()", "metricID",\n "/metric-datas/metric-data/metricName/text()", "metricName",\n\t "/metric-datas/metric-data/metricPath/text()", "metricPath",\n\t "/metric-datas/metric-data/frequency/text()", "Frequency",\n\t "/metric-datas/metric-data/metricValues/metric-value/startTimeInMillis/text()", "starttime",\n\t "/metric-datas/metric-data/metricValues/metric-value/occurences/text()", "occurences",\n\t "/metric-datas/metric-data/metricValues/metric-value/current/text()", "current",\n\t "/metric-datas/metric-data/metricValues/metric-value/min/text()", "min",\n\t "/metric-datas/metric-data/metricValues/metric-value/max/text()", "max",\n\t "/metric-datas/metric-data/metricValues/metric-value/useRange/text()", "UseRange",\n\t "/metric-datas/metric-data/metricValues/metric-value/count/text()", "count",\n\t "/metric-datas/metric-data/metricValues/metric-value/sum/text()", "sum",\n\t "/metric-datas/metric-data/metricValues/metric-value/value/text()", "value",\n\t "/metric-datas/metric-data/metricValues/metric-value/standardDeviation/text()", "SatndardDeviation",\n ", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:49:in
compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2577:in
map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:151:in
initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:24:in
initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:325:in
block in converge_state'"]}
`
Not sure if im doing this right.
@Badger , pelase help me correct this
Katara