Display all python prints in logstash

Hello,

I have a python script like this:

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:

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

can someone help us

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