# Getting 401 response while sending log to ELK using http

**URL:** <https://discuss.elastic.co/t/getting-401-response-while-sending-log-to-elk-using-http/33370>\
**Category:** Logstash\
**Created:** [October 30, 2015, 1:50pm UTC](https://discuss.elastic.co/t/getting-401-response-while-sending-log-to-elk-using-http/33370 "2015-10-30T13:50:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aniamin](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@aniamin](https://discuss.elastic.co/u/aniamin)\
**Post date:** [October 30, 2015, 1:50pm UTC](https://discuss.elastic.co/t/getting-401-response-while-sending-log-to-elk-using-http/33370/1 "2015-10-30T13:50:12Z")

</div>

I tried it from ELk server using command:  
curl -H "content-type: application/json" -XPUT '[http://elk.example.net:5555](http://elk.example.net:5555)' -d '{  
"post\_date" : "2015-10-29T15:20:34","message" : "Nowshad\_amin" }' -v  
Response:

- Rebuilt URL to: [http://elk.example.net:5555/](http://elk.example.net:5555/)
- Hostname was NOT found in DNS cache
- Trying 172.32.0.157...
- Connected to [elk.startjobs.net](http://elk.startjobs.net) (172.32.0.157) port 5555 (#0)  
PUT / HTTP/1.1  
User-Agent: curl/7.35.0  
Host: [elk.example.net:5555](http://elk.example.net:5555)  
Accept: /  
content-type: application/json  
Content-Length: 66

upload completely sent off: 66 out of 66 bytes  
\< HTTP/1.1 401 Unauthorized  
\< Content-Type: text/plain  
\< WWW-Authenticate: Basic realm=""  
\< Content-Length: 0  
\<  
Connection #0 to host [elk.example.net](http://elk.example.net) left intact

**Please take this into your consideration (For lumberjack I am using keys, but for http I am not using any keys and no authentication in my input file). I can send log using lumberjack but getting 401 response while sending log using http**

input {  
lumberjack {  
port =\> 5000  
type =\> "logs"  
ssl\_certificate =\> "/etc/pki/tls/certs/logstash-forwarder.crt"  
ssl\_key =\> "/etc/pki/tls/private/logstash-forwarder.key"  
}  
http {  
port =\> 5555  
}  
}

Any help will be highly appreciated

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 31, 2015, 11:13pm UTC](https://discuss.elastic.co/t/getting-401-response-while-sending-log-to-elk-using-http/33370/2 "2015-10-31T23:13:50Z")

</div>

401 is an authorisation problem, not an ELK one.  
You need to sort out whatever is proxying these commands and wanting auth details.

---

<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:** [July 6, 2017, 5:24am UTC](https://discuss.elastic.co/t/getting-401-response-while-sending-log-to-elk-using-http/33370/3 "2017-07-06T05:24:41Z")

</div>

Closed on July 6, 2017, 5:24am UTC


