# How to gather logs from a router

**URL:** https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660
**Category:** Logstash
**Created:** [April 18, 2020, 4:50pm UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660 "2020-04-18T16:50:41Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Hari\_Krishna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_krishna/32/62678_2.png) [@Hari\_Krishna](https://discuss.elastic.co/u/Hari_Krishna)
#### Post date: [April 18, 2020, 4:50pm UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/1 "2020-04-18T16:50:42Z")

</div>

I have a Juniper router from which i have to send logs to logstash.  
What should i do in this case

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 19, 2020, 11:24pm UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/2 "2020-04-19T23:24:27Z")

</div>

It should be able to send logs to a network based syslog destination, so use the syslog input.

---

<div class="post-metadata">

### Author: ![Hari\_Krishna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_krishna/32/62678_2.png) [@Hari\_Krishna](https://discuss.elastic.co/u/Hari_Krishna)
#### Post date: [April 20, 2020, 4:27am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/3 "2020-04-20T04:27:39Z")

</div>

Hi,  
What is the port number should i use?

And also i'm running the logstash in a virtual box

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 20, 2020, 5:46am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/4 "2020-04-20T05:46:08Z")

</div>

Usually something over 1024, as that will be an unprivileged port, so you don't need to run as root.

---

<div class="post-metadata">

### Author: ![Hari\_Krishna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_krishna/32/62678_2.png) [@Hari\_Krishna](https://discuss.elastic.co/u/Hari_Krishna)
#### Post date: [April 20, 2020, 6:20am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/5 "2020-04-20T06:20:25Z")

</div>

Hi,

```
input {
    syslog {
            host => "10.216.131.209"
            type => "syslog"
            port => 10514
          }
    }

```

I set the port number to 10514 but it gives me this warning

```
Apr 11 15:09:29 hari-VirtualBox logstash[20457]: [2020-04-11T15:09:29,496][INFO][logstash.inputs.syslog][main] Starting syslog tcp listener {:address=>"10.216.131.209:10514"}
Apr 11 15:09:29 hari-VirtualBox logstash[20457]: [2020-04-11T15:09:29,499][WARN][logstash.inputs.syslog][main] syslog listener died {:protocol=>:tcp, :address=>"10.216.131.209:10514", :exception=>#<Errno::EADDRNOTAVAIL: Cannot assign requested address - bind - Cannot assign requested address>, :backtrace=>["org/jruby/ext/socket/RubyTCPServer.java:127:in `initialize'", "org/jruby/RubyIO.java:878:in `new'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-syslog-3.4.1/lib/logstash/inputs/syslog.rb:167:in `tcp_listener'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-syslog-3.4.1/lib/logstash/inputs/syslog.rb:130:in `server'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-syslog-3.4.1/lib/logstash/inputs/syslog.rb:114:in `block in run'"]}
```

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 20, 2020, 6:45am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/6 "2020-04-20T06:45:19Z")

</div>

Is that port taken already?

---

<div class="post-metadata">

### Author: ![Hari\_Krishna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_krishna/32/62678_2.png) [@Hari\_Krishna](https://discuss.elastic.co/u/Hari_Krishna)
#### Post date: [April 20, 2020, 6:53am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/7 "2020-04-20T06:53:58Z")

</div>

No it is not taken

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 20, 2020, 6:57am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/8 "2020-04-20T06:57:26Z")

</div>

Is that IP allocated to an interface on the host?

---

<div class="post-metadata">

### Author: ![Hari\_Krishna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_krishna/32/62678_2.png) [@Hari\_Krishna](https://discuss.elastic.co/u/Hari_Krishna)
#### Post date: [April 20, 2020, 7:06am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/9 "2020-04-20T07:06:19Z")

</div>

Hi,  
It's the IP of the router from which i must collect logs.

I'm sorry. I'm just learning the basics of networking. So please guide me if i'm wrong.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 20, 2020, 7:08am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/10 "2020-04-20T07:08:58Z")

</div>

No worries 🙂

So the `host` value is the interface (IP) on the host that Logstash runs on. That is, it's the IP and port that you want to _listen on_. You'd then configure the router to send _to_ that IP and port.

---

<div class="post-metadata">

### Author: ![Hari\_Krishna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_krishna/32/62678_2.png) [@Hari\_Krishna](https://discuss.elastic.co/u/Hari_Krishna)
#### Post date: [April 20, 2020, 7:44am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/11 "2020-04-20T07:44:47Z")

</div>

Thanks warkolm. I dont see the error now. 🙂

Is it possible to configure the router to send logs to virtualbox's IP(in my case i'm running the logstash on a virtual box)

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 20, 2020, 7:45am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/12 "2020-04-20T07:45:15Z")

</div>

Most likely, you'd need to check the Juniper docs on that 🙂

---

<div class="post-metadata">

### Author: ![Hari\_Krishna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_krishna/32/62678_2.png) [@Hari\_Krishna](https://discuss.elastic.co/u/Hari_Krishna)
#### Post date: [April 20, 2020, 7:45am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/13 "2020-04-20T07:45:54Z")

</div>

sure. 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: [May 18, 2020, 7:45am UTC](https://discuss.elastic.co/t/how-to-gather-logs-from-a-router/228660/14 "2020-05-18T07:45:58Z")

</div>

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