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

Iptables module unable to parse some logs from UDM-Pro device #25615

Closed
JAndritsch opened this issue May 7, 2021 · 9 comments · Fixed by #25616
Closed

Iptables module unable to parse some logs from UDM-Pro device #25615

JAndritsch opened this issue May 7, 2021 · 9 comments · Fixed by #25616

Comments

@JAndritsch
Copy link

I'm using the Iptables module of Filebeat (master branch on Github, commit ddcf8f1aa) to receive and parse logs from a Unifi Dream Machine Pro over UDP. My module configuration looks like this:

- module: iptables
  log:
    enabled: true

The data is sent from the beat to a Logstash pipeline. That pipeline does no processing/parsing of the message itself. It just sends the incoming data into the appropriate Elasticsearch index. All of the message processing happens using the ingest pipeline provided by the Iptables module.

Most of the sample log data I've tested parses fine, however there are a handful of logs (about 70 out of 3800) that fail to parse properly by the module.

Here's a few logs that fail to parse:

May  5 20:46:45 My-Office-Gateway user.info kernel: TTL=126 ID=15317 DF PROTO=TCP SPT=59344 DPT=443 WINDOW=8212 RES=0x00 ACK PSH URGP=0
May  5 20:46:46 My-Office-Gateway user.info kernel:  TTL=126 ID=51392 DF PROTO=TCP SPT=51653 DPT=7914 WINDOW=1024 RES=0x00 ACK PSH URGP=0
May  5 20:46:46 My-Office-Gateway user.info kernel: L=126 ID=8698 DF PROTO=TCP SPT=88 DPT=51179 WINDOW=2053 RES=0x00 ACK URGP=0
May  5 20:47:09 My-Office-Gateway user.info kernel: 0 TTL=126 ID=15461 DF PROTO=TCP SPT=59289 DPT=443 WINDOW=8208 RES=0x00 ACK PSH URGP=0
May  5 20:46:56 My-Office-Gateway user.info kernel: L=126 ID=8702 DF PROTO=TCP SPT=88 DPT=51182 WINDOW=2053 RES=0x00 ACK URGP=0
May  5 20:45:44 My-Office-Gateway user.info kernel: TL=126 ID=4622 DF PROTO=TCP SPT=389 DPT=49209 WINDOW=8192 RES=0x00 ECE ACK SYN URGP=0
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 7, 2021
@legoguy1000
Copy link
Contributor

Should be easy to update the grok pattern

@legoguy1000
Copy link
Contributor

are some of those supposed to be L and TL and not TTL??

@JAndritsch
Copy link
Author

are some of those supposed to be L and TL and not TTL??

That's exactly how they appear in my log file. It almost looks as if part of the message is missing, but then the date and other information is still there.

@legoguy1000
Copy link
Contributor

are some of those supposed to be L and TL and not TTL??

That's exactly how they appear in my log file. It almost looks as if part of the message is missing, but then the date and other information is still there.

Ya, I'm definitely confused about that. Could it be a UDM bug? Did this just start happening recently? after an update??

@JAndritsch
Copy link
Author

Ya, I'm definitely confused about that. Could it be a UDM bug? Did this just start happening recently? after an update??

Same here. This is the first time I've tried collecting these logs so I can't say that it was working anytime before. I know very little about UDM, but I also wondered if it could be a bug with the device. I'll see if I can get in touch with someone who might be able to help figure this out.

Thanks for looking at this so quickly. I'll let you know when I have more information.

@legoguy1000
Copy link
Contributor

Ya, I'm definitely confused about that. Could it be a UDM bug? Did this just start happening recently? after an update??

Same here. This is the first time I've tried collecting these logs so I can't say that it was working anytime before. I know very little about UDM, but I also wondered if it could be a bug with the device. I'll see if I can get in touch with someone who might be able to help figure this out.

Thanks for looking at this so quickly. I'll let you know when I have more information.

I would hit up the Unifi forums. You'd probably get teh best answer there.

@JAndritsch
Copy link
Author

I would hit up the Unifi forums. You'd probably get teh best answer there.

That's a great idea. Thank you!

@legoguy1000
Copy link
Contributor

I opened a draft PR to parse these logs. Let me know what u think.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants