# Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id

**URL:** <https://discuss.elastic.co/t/failed-to-execute-action-action-logstash-create-pipeline-id/296138>\
**Category:** Logstash\
**Created:** [February 3, 2022, 3:59am UTC](https://discuss.elastic.co/t/failed-to-execute-action-action-logstash-create-pipeline-id/296138 "2022-02-03T03:59:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeromeat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeromeat/32/87195_2.png) [@jeromeat](https://discuss.elastic.co/u/jeromeat)\
**Post date:** [February 3, 2022, 3:59am UTC](https://discuss.elastic.co/t/failed-to-execute-action-action-logstash-create-pipeline-id/296138/1 "2022-02-03T03:59:00Z")

</div>

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:

```auto
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?

```auto
input {
  http_poller {
    urls => {
        urlname => "https://portal.website.test/api"
            {

        url => "https://portal.website.test/api"
        headers => {
          Accept => "application/json"
          Api-Token => "xxxxxxxxxxx"
          Api-Secret => "xxxxxxxxxxx"
                   }
            }
            }
        request_timeout => 60
        schedule => { every => "60s"}
        codec => "json"
              }
}

output {
        elasticsearch {
                hosts => "localhost:9200"
                index => "input_http_poller"
                      }

        stdout {
        codec => rubydebug
                }
}

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 3, 2022, 4:14am UTC](https://discuss.elastic.co/t/failed-to-execute-action-action-logstash-create-pipeline-id/296138/2 "2022-02-03T04:14:43Z")

</div>

It looks like your error message is truncated.

I do not think there is a "urlname" option, so that would result in an error once the rest of the input configuration is parsed.

You are right that `Api-Token` is not going to parse as a bareword. You should use `"Api-Token"`.

Try

```
input {
    http_poller {
        urls => {
            blah => {
                url => "https://portal.website.test/api"
                headers => {
                    "Accept" => "application/json"
                    "Api-Token" => "xxxxxxxxxxx"
                    "Api-Secret" => "xxxxxxxxxxx"
                }
....

```

The configuration compiler may parse `blah` as a bareword, but it would be more consistent to use `"blah" => {`. I have not tested if that works.

---

<div class="post-metadata">

**Author:** ![jeromeat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeromeat/32/87195_2.png) [@jeromeat](https://discuss.elastic.co/u/jeromeat)\
**Post date:** [February 3, 2022, 4:27am UTC](https://discuss.elastic.co/t/failed-to-execute-action-action-logstash-create-pipeline-id/296138/3 "2022-02-03T04:27:57Z")

</div>

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:

```auto
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'"]}

```

```auto
type or paste
input {
  http_poller {
    urls => {
        url => "https://portal.website.test/api"
        headers => {
          Accept => "application/json"
          "Api-Token" => "xxxxxxxxxxxx"
          "Api-Secret" => "xxxxxxxxxxxxxx"
                   }
            }
            }
        request_timeout => 60
        schedule => { every => "60s"}
        codec => "json"
              }
}

output {
        elasticsearch {
                hosts => "localhost:9200"
                index => "input_http_poller"
                      }

        stdout {
        codec => rubydebug
                }
}

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 3, 2022, 4:38am UTC](https://discuss.elastic.co/t/failed-to-execute-action-action-logstash-create-pipeline-id/296138/4 "2022-02-03T04:38:04Z")

</div>

> [@jeromeat](#):
>
> `\"Api\\-Secret\"`

Once it is quoted you do not need to escape it, and I think you have a left over } that you should remove.

---

<div class="post-metadata">

**Author:** ![jeromeat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeromeat/32/87195_2.png) [@jeromeat](https://discuss.elastic.co/u/jeromeat)\
**Post date:** [February 3, 2022, 2:41pm UTC](https://discuss.elastic.co/t/failed-to-execute-action-action-logstash-create-pipeline-id/296138/5 "2022-02-03T14:41:35Z")

</div>

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.

```auto
[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'"]}

```

```auto
input {
  http_poller {
    urls => {
        url => "https://portal.website.test/api"
        headers => {
          Accept => "application/json"
        \"Api\\-Secret\" => "xxxxxxxxxxx"
        \"Api\\-Secret\" => "xxxxxxxxxxx"
                   }
            }
            }
        request_timeout => 60
        schedule => { every => "60s"}
        codec => "json"
              }
}

output {
        elasticsearch {
                hosts => "localhost:9200"
                index => "iput_http_poller"
                      }

        stdout {
        codec => rubydebug
                }
}

```

---

<div class="post-metadata">

**Author:** ![jeromeat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeromeat/32/87195_2.png) [@jeromeat](https://discuss.elastic.co/u/jeromeat)\
**Post date:** [February 3, 2022, 3:07pm UTC](https://discuss.elastic.co/t/failed-to-execute-action-action-logstash-create-pipeline-id/296138/6 "2022-02-03T15:07:51Z")

</div>

Ok....I see what happened now. I had the brackets in the incorrect place. I fixed that and it's moving past that error now. Thanks for the help.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 3, 2022, 3:08pm UTC](https://discuss.elastic.co/t/failed-to-execute-action-action-logstash-create-pipeline-id/296138/7 "2022-03-03T15:08:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
