I'm currently trying to use Input http_poller to make an API call to a site to pull some data. However I keep getting the following error:
Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [A-Za-z0-9_], [ \\t\\r\\n], \"#\", \"=>\" at line 11, column 13 (byte 257) after input
I'm assuming it's because of the fields in the header section having a - in the name, but I'm not sure how to handle that. I tried to escape it out, but that cause another issue. Is there another way I should be going about this?
So I removed the urlname line as I was just following an example I saw someone else use. I also put the Api-Token and Api-Secret in "" but still failing:
Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main,
:exception=>"LogStash::ConfigurationError", :message=>"Expected one of
[ \\t\\r\\n], \"#\", \"{\" at
line 13, column 25 (byte 346) after input {\n http_poller {\n urls => {\n url =>
\"https://portal.website.test/api\"\n headers => {\n Accept => \"application/json\"\n
\"Api-Token\" => \"xxxxxxxxxxx\"\n \"Api\\-Secret\" => \"xxxxxxxxxxxxxxx\"\n
} \n }\n } \n request_timeout ", :backtrace=>["/usr/share/logstash/logstash-
core/lib/logstash/compiler.rb:32:in `compile_imperative'",
"org/logstash/execution/AbstractPipelineExt.java:189:in `initialize'",
"org/logstash/execution/JavaBasePipelineExt.java:72:in `initialize'",
"/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:47:in `initialize'",
"/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:52:in `execute'",
"/usr/share/logstash/logstash-core/lib/logstash/agent.rb:383:in `block in converge_state'"]}
I gave that try, but seems that didn't do it. Also, what extra } do you think I have? I looked and it seems to match up. But I'm a bit of a noob with this, so forgive the ignorance.
[logstash.agent ] Failed to execute action
{:action=>LogStash::PipelineAction::Create/pipeline_id:main,
:exception=>"LogStash::ConfigurationError",
:message=>"Expected one of [ \\t\\r\\n], \"#\", \"{\", \"-\",
[0-9], [A-Za-z_], '\"', \"'\", \"}\" at line 8, column 11 (
byte 169) after input {\n http_poller {\n urls =>
{\n url => \"https://portal.website.test/api"\n
headers => {\n
Accept =>
\"application/json\"\n ", :backtrace=>["/usr/share/
logstash/logstash-core/lib/logstash/compiler.rb:32:in
`compile_imperative'", "org/logstash/execution/
AbstractPipelineExt.java:189:in `initialize'", "org/logstash
/execution/JavaBasePipelineExt.java:72:in `initialize'",
"/usr/share/logstash/logstash-core/lib/logstash/
java_pipeline.rb:47:in `initialize'", "/usr/share/logstash/
logstash-core/lib/logstash/pipeline_action/create.rb:52:in `execute'",
"/usr/share/logstash/logstash-core/lib/logstash/
agent.rb:383:in `block in converge_state'"]}
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.