# How to use curl command to input data into logstash

**URL:** <https://discuss.elastic.co/t/how-to-use-curl-command-to-input-data-into-logstash/337615>\
**Category:** Logstash\
**Created:** [July 5, 2023, 6:21am UTC](https://discuss.elastic.co/t/how-to-use-curl-command-to-input-data-into-logstash/337615 "2023-07-05T06:21:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijeibarthi](https://avatars.discourse-cdn.com/v4/letter/v/8e7dd6/32.png) [@vijeibarthi](https://discuss.elastic.co/u/vijeibarthi)\
**Post date:** [July 5, 2023, 6:21am UTC](https://discuss.elastic.co/t/how-to-use-curl-command-to-input-data-into-logstash/337615/1 "2023-07-05T06:21:16Z")

</div>

Hi All,

I have a curl command which works fine but I have trouble using that curl command in the json format. Please guide on how to correct this script to output the data.

==========================================================  
\</\>  
input {  
exec {  
command =\> "curl -X 'POST'   
'[https://my.imperva.com/api/stats/v1?account\_id=#####&time\_range=last\_90\_days&start=1610356734&end=1610356734&site\_id=######&stats=bandwidth\_timeseries&granularity=7200000](https://my.imperva.com/api/stats/v1?account_id=#####&time_range=last_90_days&start=1610356734&end=1610356734&site_id=######&stats=bandwidth_timeseries&granularity=7200000)'   
-H 'accept: application/json'   
-H 'x-API-Key: #####'   
-H 'x-API-Id: #####'   
-d '' -vvv"

```
      codec => "json"
      schedule => {every =>"10s"}
        }

```

}

output {  
stdout {codec =\> rubydebug}  
}

\</\>

---

<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 2, 2023, 6:21am UTC](https://discuss.elastic.co/t/how-to-use-curl-command-to-input-data-into-logstash/337615/2 "2023-08-02T06:21:29Z")

</div>

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