I am new to ELK stack.
Trying to parse below XML code snippet through Logstash:
<?xml version="1.0"?>
Gambardella, Matthew
XML Developer's Guide
Computer
44.95
2000-10-01
An in-depth look at creating applications
with XML.
Ralls, Kim
Midnight Rain
Fantasy
5.95
2000-12-16
A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
</catalog>
Jun 14 10:53:31 test logstash[14253]: [2022-06-14T10:53:31,519][INFO ][logstash.outputs.Elasticsearch][main] Elasticsearch version determined (7.17.4) {:es_version=>7}
Jun 14 10:53:31 test logstash[14253]: [2022-06-14T10:53:31,521][WARN ][logstash.outputs.Elasticsearch][main] Detected a 6.x and above cluster: the type event field won't be used to determine the document _type {:es_version=>7}
Jun 14 10:53:31 test logstash[14253]: [2022-06-14T10:53:31,593][INFO ][logstash.outputs.Elasticsearch][main] Config is not compliant with data streams. data_stream => auto resolved to false
Jun 14 10:53:31 test logstash[14253]: [2022-06-14T10:53:31,604][INFO ][logstash.outputs.Elasticsearch][main] Config is not compliant with data streams. data_stream => auto resolved to false
Jun 14 10:53:31 test logstash[14253]: [2022-06-14T10:53:31,737][INFO ][logstash.outputs.Elasticsearch][main] Using a default mapping template {:es_version=>7, :ecs_compatibility=>:disabled}
Jun 14 10:53:32 test logstash[14253]: [2022-06-14T10:53:32,275][INFO ][logstash.javapipeline ][main] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>2, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>250, "pipeline.sources"=>["/etc/logstash/conf.d/test.conf"], :thread=>"#<Thread:0x7c4680c4 run>"}
Jun 14 10:53:33 test logstash[14253]: [2022-06-14T10:53:33,210][INFO ][logstash.javapipeline ][main] Pipeline Java execution initialization time {"seconds"=>0.93}
Jun 14 10:53:33 test logstash[14253]: [2022-06-14T10:53:33,321][INFO ][logstash.javapipeline ][main] Pipeline started {"pipeline.id"=>"main"}
Jun 14 10:53:33 test logstash[14253]: [2022-06-14T10:53:33,378][INFO ][filewatch.observingtail ][main][f22f45860093b5e6671036e486fe4177ee0847e7bf0d38553424c322662bf783] START, creating Discoverer, Watch with file and sincedb collections
Jun 14 10:53:33 test logstash[14253]: [2022-06-14T10:53:33,411][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>}
Your multiline codec is waiting for a line that matches /^<?book .*>/. Once it sees one it will flush an event onto the pipeline. You probably need to change the pattern, and also add the auto_flush_interval option to the codec, otherwise you will never get an event for the last book in the catalog.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.