udp_listener & tcp_listener set default values

closes #1936
This commit is contained in:
Cameron Sparr 2016-10-26 19:04:48 +01:00
parent 522658bd07
commit 0cfa0d419a
3 changed files with 15 additions and 7 deletions

View File

@ -44,6 +44,7 @@ continue sending logs to /var/log/telegraf/telegraf.log.
### Bugfixes ### Bugfixes
- [#1955](https://github.com/influxdata/telegraf/issues/1955): Fix NATS plug-ins reconnection logic. - [#1955](https://github.com/influxdata/telegraf/issues/1955): Fix NATS plug-ins reconnection logic.
- [#1936](https://github.com/influxdata/telegraf/issues/1936): Set required default values in udp_listener & tcp_listener.
- [#1926](https://github.com/influxdata/telegraf/issues/1926): Fix toml unmarshal panic in Duration objects. - [#1926](https://github.com/influxdata/telegraf/issues/1926): Fix toml unmarshal panic in Duration objects.
- [#1746](https://github.com/influxdata/telegraf/issues/1746): Fix handling of non-string values for JSON keys listed in tag_keys. - [#1746](https://github.com/influxdata/telegraf/issues/1746): Fix handling of non-string values for JSON keys listed in tag_keys.
- [#1628](https://github.com/influxdata/telegraf/issues/1628): Fix mongodb input panic on version 2.2. - [#1628](https://github.com/influxdata/telegraf/issues/1628): Fix mongodb input panic on version 2.2.

View File

@ -52,14 +52,14 @@ var malformedwarn = "E! tcp_listener has received %d malformed packets" +
const sampleConfig = ` const sampleConfig = `
## Address and port to host TCP listener on ## Address and port to host TCP listener on
service_address = ":8094" # service_address = ":8094"
## Number of TCP messages allowed to queue up. Once filled, the ## Number of TCP messages allowed to queue up. Once filled, the
## TCP listener will start dropping packets. ## TCP listener will start dropping packets.
allowed_pending_messages = 10000 # allowed_pending_messages = 10000
## Maximum number of concurrent TCP connections to allow ## Maximum number of concurrent TCP connections to allow
max_tcp_connections = 250 # max_tcp_connections = 250
## Data format to consume. ## Data format to consume.
## Each data format has it's own unique set of configuration options, read ## Each data format has it's own unique set of configuration options, read
@ -276,6 +276,10 @@ func (t *TcpListener) remember(id string, conn *net.TCPConn) {
func init() { func init() {
inputs.Add("tcp_listener", func() telegraf.Input { inputs.Add("tcp_listener", func() telegraf.Input {
return &TcpListener{} return &TcpListener{
ServiceAddress: ":8094",
AllowedPendingMessages: 10000,
MaxTCPConnections: 250,
}
}) })
} }

View File

@ -51,11 +51,11 @@ var malformedwarn = "E! udp_listener has received %d malformed packets" +
const sampleConfig = ` const sampleConfig = `
## Address and port to host UDP listener on ## Address and port to host UDP listener on
service_address = ":8092" # service_address = ":8092"
## Number of UDP messages allowed to queue up. Once filled, the ## Number of UDP messages allowed to queue up. Once filled, the
## UDP listener will start dropping packets. ## UDP listener will start dropping packets.
allowed_pending_messages = 10000 # allowed_pending_messages = 10000
## Data format to consume. ## Data format to consume.
## Each data format has it's own unique set of configuration options, read ## Each data format has it's own unique set of configuration options, read
@ -178,6 +178,9 @@ func (u *UdpListener) udpParser() error {
func init() { func init() {
inputs.Add("udp_listener", func() telegraf.Input { inputs.Add("udp_listener", func() telegraf.Input {
return &UdpListener{} return &UdpListener{
ServiceAddress: ":8092",
AllowedPendingMessages: 10000,
}
}) })
} }