# Field reference failure on HTTP output plugin (message option) \[SOLVED\]

**URL:** <https://discuss.elastic.co/t/field-reference-failure-on-http-output-plugin-message-option-solved/64724>\
**Category:** Logstash\
**Created:** [November 2, 2016, 2:31pm UTC](https://discuss.elastic.co/t/field-reference-failure-on-http-output-plugin-message-option-solved/64724 "2016-11-02T14:31:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kosfar](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@kosfar](https://discuss.elastic.co/u/kosfar)\
**Post date:** [November 2, 2016, 2:31pm UTC](https://discuss.elastic.co/t/field-reference-failure-on-http-output-plugin-message-option-solved/64724/1 "2016-11-02T14:31:01Z")

</div>

Hello,  
I am failing to send events to an HTTP endpoint using field reference on the "message" setting. If I use the same configuration to send a hardcoded base64 encoded string (and not reference to a field), everything works OK. Here is my configuration:

filter {  
ruby {  
code =\> "require 'base64'; event['message\_b64enc'] = Base64.encode64(event['message'])"  
}  
}

output {  
http {  
http\_method =\> "post"  
url =\> "[https://msg.argo.grnet.gr/v1/projects/GRNET-NOC/topics/LOGSTASHNOC:publish?key=XXXXXXXXXX](https://msg.argo.grnet.gr/v1/projects/GRNET-NOC/topics/LOGSTASHNOC:publish?key=XXXXXXXXXX)"  
format =\> "message"  
content\_type =\> "application/json"  
message =\> "{ "messages": [{ "attributes": {}, "data": "%{[message\_b64enc]}" } ] }"  
}  
}

On logstash I get:  
{:timestamp=\>"2016-11-02T16:06:19.227000+0200", :message=\>"[HTTP Output Failure] Encountered non-200 HTTP code 200", :response\_code=\>400, :url=\>"[https://msg.argo.grnet.gr/v1/projects/GRNET-NOC/topics/LOGSTASHNOC:publish?key=XXXXXXXXXXXXXXXXXXX](https://msg.argo.grnet.gr/v1/projects/GRNET-NOC/topics/LOGSTASHNOC:publish?key=XXXXXXXXXXXXXXXXXXX)

and on my endpoint:  
ERROR#011400#011Invalid Message Arguments

It seems that I am missing something but not sure what. Any help would be appreciated.

Kindly,  
Kostis

---

<div class="post-metadata">

**Author:** ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)\
**Post date:** [November 3, 2016, 10:43am UTC](https://discuss.elastic.co/t/field-reference-failure-on-http-output-plugin-message-option-solved/64724/2 "2016-11-03T10:43:01Z")

</div>

the normal Base64.encode64 adds a `\n` at the end of the string. can you try with `Base64.strict_encode64(event['message'])` instead?

---

<div class="post-metadata">

**Author:** ![kosfar](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@kosfar](https://discuss.elastic.co/u/kosfar)\
**Post date:** [November 3, 2016, 11:54am UTC](https://discuss.elastic.co/t/field-reference-failure-on-http-output-plugin-message-option-solved/64724/3 "2016-11-03T11:54:52Z")

</div>

@jsvd thanks mate, that was the problem

---

<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, 4:31am UTC](https://discuss.elastic.co/t/field-reference-failure-on-http-output-plugin-message-option-solved/64724/4 "2017-07-06T04:31:17Z")

</div>

Closed on July 6, 2017, 4:31am UTC


