# Curl command as streaming

**URL:** <https://discuss.elastic.co/t/curl-command-as-streaming/308838>\
**Category:** Logstash\
**Created:** [July 4, 2022, 11:38pm UTC](https://discuss.elastic.co/t/curl-command-as-streaming/308838 "2022-07-04T23:38:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Didi\_Sisi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/didi_sisi/32/79762_2.png) [@Didi\_Sisi](https://discuss.elastic.co/u/Didi_Sisi)\
**Post date:** [July 4, 2022, 11:38pm UTC](https://discuss.elastic.co/t/curl-command-as-streaming/308838/1 "2022-07-04T23:38:46Z")

</div>

Hello ;

I want to use twitter streaming api V2. because the twitter plugin of logstash is not working with twitter api 2. I decided to use curl commands.

I defined the rules. like this:

```auto
curl --location --request POST 'https://api.twitter.com/2/tweets/search/stream/rules' \
--header 'Content-type: application/json' \
--header 'Authorization: Bearer AAAAAAAAAAAAAAAAAAAAAJ ****' \
--header 'Cookie: guest_id=v1%3A165697294294313514' \
--data-raw '{
   "add":[
      {
         "tag":"test test",
         "value":"hello"
      }
   ]
}'

```

Then I have to execute a curl get , to fetch , in real time the tweets with Hello keyword.

The problem i faced is: I have to execute this curl command each xx seconds. it returns the tweets published in the time of execution. but i loose those published between the deadtime. i.e. between the two executions of the curl.

My question. is there any ways to run this curl command

```auto
curl --location --request GET 'https://api.twitter.com/2/tweets/search/stream?tweet.fields=created_at,geo,id,lang,text' \
--header 'Authorization: Bearer AAAAAAAAAAAAAAAAAAAAAJ8Rd***'

```

as a stream? using logstash , or python?

thanks

---

<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 1, 2022, 11:39pm UTC](https://discuss.elastic.co/t/curl-command-as-streaming/308838/2 "2022-08-01T23:39:23Z")

</div>

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