Storing packets on Data Base
I'm developing a project to store real-time packet capture data on a DB. My current strategy is to run Tshark to make a JSON file and then read that by script and store it on DB. But here I'm facing an issue script not being able to read JSON file simultaneously. it says "Permission Denied". I need help with this. Is there any better strategy or this is the one? Because this is also memory-consuming because the .pcapng file also creating behind with json file because both are useless because DB is what I need. My ultimate goal is to access packet data through API by a GUI.
Can you modify your script to read from a pipe instead of a file?
tshark -T json | script.foo
I'm also recenly discovered this method with chat GPT. But so buggy ;). What is the difference between "tshark -T json | script.foo" and "tshark -T json >> script.foo" . Also sir I need to know is this the comman approach i can follow? Because still .pcapng file is usless for me. It's using huge amount of space.
|
pipes the output oftshark
to the input of scriptscript.foo
.>>
redirects the output oftshark
to append to a file calledscript.foo
.This works. Thanks. I'm using
tshark -i Wi-Fi -T json | ./pipe.py
command with python script. I have to deal with High traffic in future. What can i improve in tshark command.