# Logstash collecting logs from the switch

**URL:** <https://discuss.elastic.co/t/logstash-collecting-logs-from-the-switch/354788>\
**Category:** Logstash\
**Created:** [March 6, 2024, 3:17am UTC](https://discuss.elastic.co/t/logstash-collecting-logs-from-the-switch/354788 "2024-03-06T03:17:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yogesh\_AS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yogesh_as/32/131781_2.png) [@Yogesh\_AS](https://discuss.elastic.co/u/Yogesh_AS)\
**Post date:** [March 6, 2024, 3:17am UTC](https://discuss.elastic.co/t/logstash-collecting-logs-from-the-switch/354788/1 "2024-03-06T03:17:00Z")

</div>

Hi ,

I am not getting any logs from the switch tough it is currently configured in switch level also and please find my below code

input {  
udp {  
port =\> 5145  
type =\> syslog  
}  
}

filter {  
if [type] == "syslog" and [syslog\_facility] == "local7" {  
if "ERROR" in [message] {  
mutate {  
add\_tag =\> ["error"]  
}  
} else if "WARNING" in [message] {  
mutate {  
add\_tag =\> ["warning"]  
}  
} else {  
mutate {  
add\_tag =\> ["info"]  
}  
}  
}  
}

output {  
stdout {  
codec =\> rubydebug  
}  
}  
Let me know what is the issues here why logs are not coming from switch when I run the command below/usr/share/logstash/bin/logstash --path.settings /etc/logstash/ -f /etc/logstash/conf.d/switchlogs.conf

---

<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:** [April 3, 2024, 3:17am UTC](https://discuss.elastic.co/t/logstash-collecting-logs-from-the-switch/354788/2 "2024-04-03T03:17:26Z")

</div>

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