Giter Club home page Giter Club logo

Comments (5)

robcowart avatar robcowart commented on June 6, 2024

There really isn't a good way to do this without code from outside of the Elasticstack. Probably the best place to do this is first stick the flows into Kafka and write a Streams app for it.

I am open for suggestions here, but I am hesitant to expand ElastiFlow beyond the core of Elasticsearch, Kibana and Logstash.

from elastiflow.

jorritfolmer avatar jorritfolmer commented on June 6, 2024

The first step would be to calculate a common id field for the forward and reverse flows, so you can group on this new field. Let's call it "flow_key" or something. You basically calculate some integer for both directions, and ADD these two values. Because you add them, the sum will be equal for reverse and forward flows. Now you can use this new common field to do other operations on.

Example integers for forward flow:

  • 28867323006035317 (172.16.10.12 in decimal is 2886732300 for src_ip, appended with 60352 for src port numer, appended with 17 for the udp protocol number)
  • 1347440725317 (8.8.8.8 in decimal is 134744072 for dest_ip, appended with 53 for the dest_port, appended with 17 for the protocol number for udp)
  • sum = 28868670446760634

Example integers for reverse flow:

  • 1347440725317
  • 28867323006035317
  • sum = 28868670446760634

Generating this field "flow_key" could be implemented as an Elasticsearch script, for example in Painless.

from elastiflow.

jorritfolmer avatar jorritfolmer commented on June 6, 2024

I did something similar in Splunk a while a go based on the JSON output from Logstash: https://github.com/jorritfolmer/TA-netflow-logstash. It's a two part operation:

  1. perform some aggregations on the flow_key, keep only the flows where src_port>dest_port, and save to a new index
  2. use this new index for dashboarding or alerting.

You can see the search I used here: https://github.com/jorritfolmer/TA-netflow-logstash/blob/master/default/savedsearches.conf#L12-L25
Splunk has much more flexibility in terms processing and analytics, but I believe this could also be done in Elasticsearch "Painless" scripting.

from elastiflow.

bewing avatar bewing commented on June 6, 2024

For deduplication -- we have multiple routers sending sflow data into logstash, and it would be nice if we could use an aggregation filter that records all the common records of a flow, and then has a list of node_ids the record was received from. Ideally, we'd be able to expire the raw records after a short period of time, and keep the deduplicated aggregation records for a longer period. It looks like something that could be done in logstash via fingerprinting and aggregate filters, as long as the timeouts were configurable.

from elastiflow.

robcowart avatar robcowart commented on June 6, 2024

This issue is being closed as this legacy version of ElastiFlow is now deprecated and is to be archived. Please try the new ElastiFlow, request a free Basic Tier license, and join the ElastiFlow Community Slack. Thank you.

from elastiflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.