# How to add multiple host and IP in stream rule

**URL:** <https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983>\
**Category:** Graylog Central (peer support)\
**Created:** [May 27, 2021, 9:22am UTC](https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983 "2021-05-27T09:22:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepakkumardubey](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/deepakkumardubey/32/8664_2.png) [@deepakkumardubey](https://community.graylog.org/u/deepakkumardubey)\
**Post date:** [May 27, 2021, 9:22am UTC](https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983/1 "2021-05-27T09:22:10Z")

</div>

Hello Friends,

As I am getting requests from multiple host machines, how to create stream rule so that all messages can get on a single port.

---

<div class="post-metadata">

**Author:** ![shoothub](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/shoothub/32/6412_2.png) [@shoothub](https://community.graylog.org/u/shoothub)\
**Post date:** [May 27, 2021, 11:09am UTC](https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983/2 "2021-05-27T11:09:26Z")

</div>

Create more stream rules with condition any match (not all match).

---

<div class="post-metadata">

**Author:** ![deepakkumardubey](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/deepakkumardubey/32/8664_2.png) [@deepakkumardubey](https://community.graylog.org/u/deepakkumardubey)\
**Post date:** [May 27, 2021, 1:33pm UTC](https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983/3 "2021-05-27T13:33:38Z")

</div>

I am not able to send my log message from fluentbit to Graylog. I am using gelf setting. I have used same settings for another clients those are working . But some clients are not working.

---

<div class="post-metadata">

**Author:** ![shoothub](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/shoothub/32/6412_2.png) [@shoothub](https://community.graylog.org/u/shoothub)\
**Post date:** [May 27, 2021, 1:54pm UTC](https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983/4 "2021-05-27T13:54:06Z")

</div>

Check graylog server log file for any errors, maybe your gelf is not complaint.  
`sudo tail -f /var/log/graylog-server/server.log`

---

<div class="post-metadata">

**Author:** ![deepakkumardubey](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/deepakkumardubey/32/8664_2.png) [@deepakkumardubey](https://community.graylog.org/u/deepakkumardubey)\
**Post date:** [May 27, 2021, 2:41pm UTC](https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983/5 "2021-05-27T14:41:10Z")

</div>

Request is not reaching to Graylog. I can see in the logs for other clients IP, it’s showing but some it’s not.

I have compared both configuration no difference.

---

<div class="post-metadata">

**Author:** ![shoothub](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/shoothub/32/6412_2.png) [@shoothub](https://community.graylog.org/u/shoothub)\
**Post date:** [May 28, 2021, 5:29am UTC](https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983/6 "2021-05-28T05:29:20Z")

</div>

Maybe there is a firewall, that blocks such connection, please check…

If you use GELP HTTP input try to send example message using curl:  
`curl -XPOST http://graylog.example.org:12202/gelf -p0 -d '{"short_message":"Hello there", "host":"example.org", "facility":"test", "_foo":"bar"}'`

If you use GELF UDP input try to send example message using nc:  
`echo -n '{ "version": "1.1", "host": "example.org", "short_message": "A short message", "level": 5, "_some_info": "foo" }' | nc -w0 -u graylog.example.com 12201`

If you use GELP TCP input try to send example message using nc:  
`echo -n -e '{ "version": "1.1", "host": "example.org", "short_message": "A short message", "level": 5, "_some_info": "foo" }'"\0" | nc -w0 graylog.example.com 12201`

---

<div class="post-metadata">

**Author:** ![deepakkumardubey](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/deepakkumardubey/32/8664_2.png) [@deepakkumardubey](https://community.graylog.org/u/deepakkumardubey)\
**Post date:** [June 1, 2021, 4:18am UTC](https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983/7 "2021-06-01T04:18:51Z")

</div>

Hi Shootub,

I have used below command as we are using GELF TCP.  
If you use GELP TCP input try to send example message using nc:  
`echo -n -e '{ "version": "1.1", "host": "example.org", "short_message": "A short message", "level": 5, "_some_info": "foo" }'"\0" | nc -w0 10.24.11.23 12201`

But we are getting below error.

Ncat: Invalid -w timeout (must be greater than 0). QUITTING.

Then i replaced | nc -w0 with | nc -w1 and executed below command.

echo -n -e ‘{ “version”: “1.1”, “host”: “[example.org](http://example.org)”, “short\_message”: “A short message”, “level”: 5, “\_some\_info”: “foo” }’"\0" | nc -w1 10.24.11.23 12201

Above command not showing me any error but i can’t see any message in Graylog UI and logs.

---

<div class="post-metadata">

**Author:** ![shoothub](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/shoothub/32/6412_2.png) [@shoothub](https://community.graylog.org/u/shoothub)\
**Post date:** [June 1, 2021, 8:17am UTC](https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983/8 "2021-06-01T08:17:51Z")

</div>

Yes, you are right, w0 is parameter for older version of nc.

It should definitely work. If not, try to check if something not block this connection, like firewall. Try to telnet to port, to check if your connection in not blocked:  
`telnet 10.24.11.23 12201`

If not works, try to create new test Gelf TCP input with different port, and try it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [June 15, 2021, 8:18am UTC](https://community.graylog.org/t/how-to-add-multiple-host-and-ip-in-stream-rule/19983/9 "2021-06-15T08:18:44Z")

</div>

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