# Logstah http filter merge and add and array

**URL:** https://discuss.elastic.co/t/logstah-http-filter-merge-and-add-and-array/232159
**Category:** Logstash
**Created:** [May 12, 2020, 7:58am UTC](https://discuss.elastic.co/t/logstah-http-filter-merge-and-add-and-array/232159 "2020-05-12T07:58:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![katara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/katara/32/60143_2.png) [@katara](https://discuss.elastic.co/u/katara)
#### Post date: [May 12, 2020, 7:58am UTC](https://discuss.elastic.co/t/logstah-http-filter-merge-and-add-and-array/232159/1 "2020-05-12T07:58:24Z")

</div>

Hi,  
I am sending my data to a http url which I want to be in the below format:

> ```
> {
> "action":"EventsRouter",
> "method":"add_event",
> "data": [ 
> { "summary": Error 123", 
> "device":"device01",
> "message":" Error 123 , Application name: App01" ,
> "severity":"error", 
> "evclasskey":"SybaseDBErrorLog Check blocking",
> "evclass":"/Status/JAPI/Sybase"
> }
> ],
> "type": "rpc",
> "tid":1 
> }
> 
> ```

Here's my http filter so far,

> ```
> filter
> {
> mutate {
> add_field {"summary" => "[Message]"}}
> mutate {
> add_field {"device" => "[host]"}}
> mutate {
> add_field {"message" => "[Message]" "," "[ApplicationName]"}} #is this correct?#
> mutate {
> add_field {"severity" => "[Severity]"}}
> mutate {
> add_field {"evclasskey" =>"SybaseDBErrorLog Check blocking"}}
> mutate {
> add_field {"evclass"=> "/Status/JAPI/Sybase"}}
> 
> http {
> body_format => "json"
> follow_redirects => false
> body => {
> "action" =>"EventsRouter",
> "method"=>"add_event"
> "data" => %{[array]}
> "type" => "rpc"
> "tid" => 1
> }
> }
> 
> ```

**I do not know how to bring all the mutated fields under the data section in the http block.**  
**How can i do it?**

Im expecting to send these in an exec block with a curl command to my url.

> ```
> output {
> exec
> {
> command => "curl -u username:'password' -k https://url.com/zdmd/Events/evconsole_router -d %{request_body}"
> }
> }
> 
> ```

I cannot use the HTTP output as there is a cacert issue with it.

Please help me define this right.

---

<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: [June 9, 2020, 7:58am UTC](https://discuss.elastic.co/t/logstah-http-filter-merge-and-add-and-array/232159/2 "2020-06-09T07:58:26Z")

</div>

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