Tshark(wireshark) to MongoDB [SOLVED]


#1

Hello dear Meteor users!

Some friend suggested to start using meteor as it was quicker in dealing with large piles of data.
So i’m very new to this environment and would really appreciate some help!!

I’m using Wireshark via Terminal for sniffing my http traffic as such:

tshark -i en0 -Y "http" -T fields -e http.request.full_uri -l > http_summary.txt

This filters out all http traffic, gets the full http url and writes it into a word document.
I could than use a jQuery function to load it into the mongoDB, but because javascript is only single treaded, and wireshark outputs 500+ lines a second, this is not very fast/efficient.

i tried something like this which looked promising but gives me errors I don’t fully understand:

tshark -i en0 -Y "http" -T fields -e http.request.full_uri -l | while read -r line; do meteor mongo db.tasks.insert\( \{ text\: \"hello world\" \} \); done

mongo: too many arguments.
Usage: meteor mongo [--url]

Opens a Mongo shell to view or manipulate collections.

If site is specified, this is the hosted Mongo database for the deployed
Meteor site.

If no site is specified, this is the current project's local development
database. In this case, the current working directory must be a
Meteor project directory, and the Meteor application must already be
running.

Instead of opening a shell, specifying --url (-U) will return a URL
suitable for an external program to connect to the database. For remote
databases on deployed applications, the URL is valid for one hour.

Options:
  --url, -U  return a Mongo database URL

I’m running this project local:3000 so I don’t understand why it’s asking for a URL??

Any suggestions are very much appreciated!


#2

You could try re-arranging things a bit to pipe your commands into the Meteor mongo shell. For example, something like this will work:

echo "show collections" | meteor mongo

#3

this kind of helped me/made it work, thanks!