Skip to content

Updating the logstash configuration to handle asa#10001

Open
toddferg wants to merge 1 commit intoelastic:mainfrom
toddferg:master
Open

Updating the logstash configuration to handle asa#10001
toddferg wants to merge 1 commit intoelastic:mainfrom
toddferg:master

Conversation

@toddferg
Copy link
Copy Markdown

Cisco ASA sends in fwd_flow_delta_bytes and rev_flow_delta_bytes for bytes, and initiatorPackets and responderPackets for packets. Just normalizing it.

Should fix logstash-plugins/logstash-codec-netflow#112

Cisco ASA sends in fwd_flow_delta_bytes and rev_flow_delta_bytes for bytes, and initiatorPackets and responderPackets for packets. Just normalizing it.
Copy link
Copy Markdown
Member

@yaauie yaauie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution 🎉

I've left a couple comments about fixing this up, mostly about ordering to ensure we don't change the behaviour of existing flows.

rename => { "[netflow][fwd_flow_delta_bytes]" => "[netflow][bytes]" }
}
}
if [netflow][rev_flow_delta_bytes] {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be else if -- we don't want to overwrite the value unnecessarily if both are present.


# Populate bytes transferred in the flow.

if [netflow][fwd_flow_delta_bytes] {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to preserve behaviour when flow includes these values and one of the other values that could write [netflow][bytes], these should be added at the tail of the else if chain.

We should only take one of these paths after observing the absence of [netflow][in_bytes], [netflow][out_bytes], and [netflow][in_permanent_bytes].

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, during Support Summit I handled a ticket where the user had extracted this pipeline and encountered this issue exactly (it may have been Todd's ticket). The Cisco ASA pcap showed that fwd_flow_delta_bytes and rev_flow_delta_bytes were both present and not necessary equal. Same with initiatorPackets, responderPackets, initiatorOctets and responderOctets

From a Cisco Community Support ticket

New fields 231 (initiatorOctets) and 232 (responderOctets) will replace field 85 (IN_PERMANENT_BYTES) along with real-time flow update support in 8.4(5) and later software. However, it may take a bit for third-party Netflow Collectors to pick up these new fields as they come from IPFIX rather than legacy Netflow V9 world.

See what Robert Cowart did here

}

# Populate packets transferred in the flow.
if [netflow][initiatorPackets] {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here, these two clauses should be else if-joined and should be at the tail of the else if chain.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 5, 2025

This pull request does not have a backport label. Could you fix it @toddferg? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • backport-8.x is the label to automatically backport to the 8.x branch.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 5, 2025

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Netflow sent by Cisco ASA 9.6(1) doesn't contain IN_BYTES and IN_PACKETS

4 participants