Coder Social home page Coder Social logo

Comments (5)

lspgn avatar lspgn commented on August 28, 2024 1

Updated debug message. Now converting bytes into readable string.

from goflow.

lspgn avatar lspgn commented on August 28, 2024

It is technically debug output and not meant to be pushed directly to logstash for analysis.
Right now, it is directly printing the protobuf. Since the IPs are bytes, it will be serialized as base64. I was hoping to improve this for clarity anyway.

from goflow.

simPod avatar simPod commented on August 28, 2024

@lspgn how would you decode it?

I serialized protobuf generated by goflow to json in php script:

{"Type":"SFLOW","TimeRecvd":1537348610,"SamplingRate":16383,"SequenceNum":2702862506,"TimeFlow":1537348610,"SrcIP":"uWbaPA==","DstIP":"uWbbjw==","IPversion":"IPv4","Bytes":1522,"Packets":1,"RouterAddr":"uWba/g==","NextHop":"lQ6PeQ==","SrcNet":27,"SrcIf":1000013,"DstIf":1000001,"Proto":6,"SrcPort":1918,"DstPort":34379,"IPTTL":64,"TCPFlags":16,"VlanId":970,"Etype":2048}

And when I take src ip uWbaPA== and try to decode it it seems like it's somehow corrupted 🤔

image

from goflow.

lspgn avatar lspgn commented on August 28, 2024

The protobuf serializer will encode bytes directly into Base64.
I will take a look at improving this.

$ echo -n "uWbaPA==" | openssl enc -a -d -A | hexdump -C
00000000  b9 66 da 3c                                       |.f.<|
00000004

When you convert it
b9 66 da 3c => 185.102.218.60

from goflow.

simPod avatar simPod commented on August 28, 2024

Yup, got it. Thanks!

from goflow.

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.