Hi all,
I want to load data from an api rest (response xml) using logstash 7.9.0
this is my config file:
input {
http_poller {
urls => {
method => get
url1 => "https://*******/rest/1.0/geography"
user =>"*********.com"
password =>"******"
}
schedule => { every => "70s" }
request_timeout => 60
codec => "plain"
}
}
filter {
xml {
source => "message"
force_array => false
target => "parsed"
}
}
output {
elasticsearch {
hosts => "localhost:9200"
index => "cities"
user => elastic
password => *****
action => "insert"
doc_as_upsert => "true"
}
stdout {codec => dots}
}
this is the error:
C:\ELK\ELK.7.9.0\logstash-7.9.0\logstash-7.9.0\bin>logstash -f cities.conf
Sending Logstash logs to C:/ELK/ELK.7.9.0/logstash-7.9.0/logstash-7.9.0/logs which is now configured via log4j2.properties
[2021-02-09T15:29:58,961][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.9.0", "jruby.version"=>"jruby 9.2.12.0 (2.5.7) 2020-07-01 db01a49ba6 Java HotSpot(TM) 64-Bit Server VM 25.211-b12 on 1.8.0_211-b12 +indy +jit [mswin32-x86_64]"}
[2021-02-09T15:29:59,223][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2021-02-09T15:30:01,267][INFO ][org.reflections.Reflections] Reflections took 37 ms to scan 1 urls, producing 22 keys and 45 values
[2021-02-09T15:30:02,247][INFO ][logstash.outputs.elasticsearch][main] Elasticsearch pool URLs updated {:changes=>{:removed=>, :added=>[http://elastic:xxxxxx@localhost:9200/]}}
[2021-02-09T15:30:02,457][WARN ][logstash.outputs.elasticsearch][main] Restored connection to ES instance {:url=>"http://elastic:xxxxxx@localhost:9200/"}
[2021-02-09T15:30:02,499][INFO ][logstash.outputs.elasticsearch][main] ES Output version determined {:es_version=>7}
[2021-02-09T15:30:02,502][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}
[2021-02-09T15:30:02,578][ERROR][logstash.agent ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create, action_result: false", :backtrace=>nil}
[2021-02-09T15:30:02,603][INFO ][logstash.outputs.elasticsearch][main] Using a default mapping template {:es_version=>7, :ecs_compatibility=>:disabled}
[2021-02-09T15:30:02,680][INFO ][logstash.outputs.elasticsearch][main] Attempting to install template {:manage_template=>{"index_patterns"=>"logstash-", "version"=>60001, "settings"=>{"index.refresh_interval"=>"5s", "number_of_shards"=>1}, "mappings"=>{"dynamic_templates"=>[{"message_field"=>{"path_match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false}}}, {"string_fields"=>{"match"=>"", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false, "fields"=>{"keyword"=>{"type"=>"keyword", "ignore_above"=>256}}}}}], "properties"=>{"@timestamp"=>{"type"=>"date"}, "@version"=>{"type"=>"keyword"}, "geoip"=>{"dynamic"=>true, "properties"=>{"ip"=>{"type"=>"ip"}, "location"=>{"type"=>"geo_point"}, "latitude"=>{"type"=>"half_float"}, "longitude"=>{"type"=>"half_float"}}}}}}}
[2021-02-09T15:30:02,903][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2021-02-09T15:30:07,808][INFO ][logstash.runner ] Logstash shut down.
[2021-02-09T15:30:07,824][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
Any help please !!!