Logstash if statement for program

i have found out if i do import filter and output in the same file and run it with logstash -f it does everything right but when it runs from systemctl it wond work