# Display all python prints in logstash

**URL:** <https://discuss.elastic.co/t/display-all-python-prints-in-logstash/310351>\
**Category:** Logstash\
**Created:** [July 21, 2022, 11:25pm UTC](https://discuss.elastic.co/t/display-all-python-prints-in-logstash/310351 "2022-07-21T23:25:08Z")\
**Posts on this page:** 3\
**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 21, 2022, 11:25pm UTC](https://discuss.elastic.co/t/display-all-python-prints-in-logstash/310351/1 "2022-07-21T23:25:09Z")

</div>

Hello,

I have a python script like this:

```auto
import time
dictionary1 ={ 
      "id": "02", 
      "name": "sunil", 
      "department": "HR"
    } 

dictionary2 ={ 
      "id": "03", 
      "name": "sunilals", 
      "department": "SAV"
    } 
    
    
print(dictionary1)
time.sleep(20)
print(dictionary2)

```

I want to execute this script from logstash, and display the two prints. My logstash file is:

```auto
input {
exec {
command => 'python test.py'
interval => 100
}
}

filter {
   
      mutate { gsub => ["message", "'", '"'] }
json { source => "message" }
mutate {
      rename => {
        "[id]" => "tweet_content"
}
add_field => {
        "is_a_retweet" => true
      }
remove_field => ["message"]
}
}
output {
stdout {
codec => rubydebug
}
}

```

The issue is that, it returns me just the second print.  
How can I force ot the display the both .?

thank you

---

<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:** [August 1, 2022, 11:39am UTC](https://discuss.elastic.co/t/display-all-python-prints-in-logstash/310351/2 "2022-08-01T11:39:30Z")

</div>

can someone help us

---

<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 29, 2022, 11:39am UTC](https://discuss.elastic.co/t/display-all-python-prints-in-logstash/310351/3 "2022-08-29T11:39:57Z")

</div>

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