# Logstash HTTP code 400 {:response\_code=\>400}

**URL:** https://discuss.elastic.co/t/logstash-http-code-400-response-code-400/338501
**Category:** Elasticsearch
**Created:** [July 17, 2023, 6:07am UTC](https://discuss.elastic.co/t/logstash-http-code-400-response-code-400/338501 "2023-07-17T06:07:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Indeed2000](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@Indeed2000](https://discuss.elastic.co/u/Indeed2000)
#### Post date: [July 17, 2023, 6:07am UTC](https://discuss.elastic.co/t/logstash-http-code-400-response-code-400/338501/1 "2023-07-17T06:07:38Z")

</div>

Hi  
when i try to send data with logstash to influxdb return this error:

`[ERROR] 2023-07-17 09:21:36.133 [[main]>worker1] http - Encountered non-2xx HTTP code 400 {:response_code=>400, :url=>"http://192.168.1.2:8086/api/v2/write?bucket=mybucket&precision=s&org=myorg", :event=>#<LogStash::Event:0x397c42fa>}`

Here is my logstash config that need to send simple message like this to influxdb oss2.

logstash config:

```auto
input {
  stdin {
    codec => plain {
      charset => "UTF-8"
    }
  }
}

filter {
  grok {
    match => { "message" => "%{TIME:time} %{GREEDYDATA:message}" }
  }
}

output {
  http {
    url => "http://192.168.1.1:8086/api/v2/write?bucket=mybucket&precision=s&org=myorg"
    http_method => "post"
    headers => [
      'Authorization', 'Token mytoken'
    ]
  }
}

```

FYI: because i'm using influxdb oss2, this [plugins-outputs-influxdb](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-influxdb.html) not work anymore so i use this one instead [plugins-outputs-http](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-http.html).

Any idea?

---

<div class="post-metadata">

### Author: ![PodarcisMuralis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/podarcismuralis/32/122606_2.png) [@PodarcisMuralis](https://discuss.elastic.co/u/PodarcisMuralis)
#### Post date: [July 17, 2023, 7:19pm UTC](https://discuss.elastic.co/t/logstash-http-code-400-response-code-400/338501/2 "2023-07-17T19:19:13Z")

</div>

Hi.

I had the same issue. It is a bug in the plugin itself. I spent 2 days on this.

Please check this out.

> [@Logstash pipeline Http output plugin error "\[HTTP Output Failure\] Encountered non-2xx HTTP code 400"](https://discuss.elastic.co/t/logstash-pipeline-http-output-plugin-error-http-output-failure-encountered-non-2xx-http-code-400/338116):
>
> Hi all, I have a logstash output http plugin: output { if [@metadata][index\_to\_delete] == "first\_index" or [@metadata][index\_to\_delete] == "second\_index" { http { id =\> "http\_index\_delete" url =\> "https://HOST:9200/%{[@metadata][index\_to\_delete]}" http\_method =\> "delete" cacert =\> 'mycert.cer' user =\> "user\_with\_delete\_index\_right" password =\> "mypass" } } } An I get this error: [2023-07-11T16:15:03,083][ERROR][lo…

---

<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: [August 14, 2023, 7:19pm UTC](https://discuss.elastic.co/t/logstash-http-code-400-response-code-400/338501/3 "2023-08-14T19:19:17Z")

</div>

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