Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for fields for network and network_path #20

Open
TomonoriSoejima opened this issue Sep 11, 2019 · 3 comments
Open

Support for fields for network and network_path #20

TomonoriSoejima opened this issue Sep 11, 2019 · 3 comments

Comments

@TomonoriSoejima
Copy link

TomonoriSoejima commented Sep 11, 2019

It looks like network and network_path only accepts a hardcoded value while you can specify fields in address.

I think it would benefit users who want to dynamically maintain them.
Currently, you have to reload the config each time you need to change them and it is an extra cost for those managing the system.

@magnusbaeck
Copy link
Collaborator

As I read the code the network option supports field references (see cidr.rb:159). What leads you to the conclusion this it doesn't work?

However, network_path doesn't support field references and I'm not sure it should either.

@TomonoriSoejima
Copy link
Author

I have not tested it myself, but with a config below produced the warning message appears that that the field whitelist did not get expanded.

cidr { 
add_tag => [ "whitelist" ] 
address => [ "%{source.ip}" ] 
network => [ "%{whitelist}" ] 
} 
[2019-09-10T17:37:00,236][WARN ][logstash.filters.cidr ] Invalid IP network, skipping {:network=>"%{whitelist}", :event=>#<LogStash::Event:0xf7d72a7>} 

@magnusbaeck
Copy link
Collaborator

And what does the input event look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants