Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

lua_scriptnum:argument

My lua script works more or less. Now, I want to use it to write some of the extracted data to a XML file. I want to use the same script file, so I decided to test if there is argument send to the script.

  1. If yes, this means the script is called from command line with tshark, and then I can write specific data.
  2. If no, this means it is call from Wireshark so I wiil not record XML file this time.

My problem is that when I call from command line with :

tshark -r test_210.pcapng -Y tgip -q > test.txt -X lua_script1:arg1 -X lua_script2:arg2

The arguments are not seen by the script, I suppose it is because I don't use -X option. With :

tshark -r test_210.pcapng -X lua_script:Gip.lua -Q  -X lua_script1:arg1 -X lua_script2:arg2

I have an error : Gip.lua:34: bad argument #2 to 'Proto' (Proto_new: there cannot be two protocols with the same description) I suppose it is because the script is all ready loaded, and I call it again with -X.

Do you any idea to solve this ?