# How to use http input logstash

**URL:** <https://discuss.elastic.co/t/how-to-use-http-input-logstash/311928>\
**Category:** Logstash\
**Created:** [August 11, 2022, 1:06pm UTC](https://discuss.elastic.co/t/how-to-use-http-input-logstash/311928 "2022-08-11T13:06:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cihady](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@cihady](https://discuss.elastic.co/u/cihady)\
**Post date:** [August 11, 2022, 1:06pm UTC](https://discuss.elastic.co/t/how-to-use-http-input-logstash/311928/1 "2022-08-11T13:06:46Z")

</div>

I am trying to api call logstash by using http input but when I run logstash it failse and throws the error below

Here is my config file

```auto
input {
  http {
		host=>0.0.0.0
		port =>2020
  }
}

output {
  elasticsearch {
    hosts => ["1.12.73.45:9200"]
	index => "frontend"
  }
}

```

and here is my error log

`Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [0-9], [\\t\\r\\n], \"#\", \"}\" at line 3, column 12 (byte 29) after input {\n http {\n\t\thost=>0.0", :backtrace=>["D:/elk/logstash-8.3.2/logstash-core/lib/logstash/compiler.rb:32:in `compile\_imperative'", "org/logstash/execution/AbstractPipelineExt.java:199:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:72:in `initialize'", "D:/elk/logstash-8.3.2/logstash-core/lib/logstash/java\_pipeline.rb:48:in `initialize'", "D:/elk/logstash-8.3.2/logstash-core/lib/logstash/pipeline_action/create.rb:50:in `execute'", "D:/elk/logstash-8.3.2/logstash-core/lib/logstash/agent.rb:381:in `block in converge_state'"]}`

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [August 11, 2022, 1:19pm UTC](https://discuss.elastic.co/t/how-to-use-http-input-logstash/311928/2 "2022-08-11T13:19:55Z")

</div>

try this

```auto
input {
  http {
		host=>"0.0.0.0"
		port =>"2020"
  }
}

```

---

<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:** [September 8, 2022, 1:19pm UTC](https://discuss.elastic.co/t/how-to-use-http-input-logstash/311928/3 "2022-09-08T13:19:58Z")

</div>

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