1 | initial version |
tshark -r test_210.pcapng -X lua_script:Gip.lua -Q -X lua_script1:arg1 -X lua_script2:arg2
I don't think this follows the rules for passing arguments to a lua script. From the tshark man page:
lua_script:lua_script_filename tells TShark to load the given script in addition to the default Lua scripts.
lua_scriptnum:argument tells TShark to pass the given argument to the lua script identified by 'num', which is the number indexed order of the 'lua_script' command. For example, if only one script was loaded with '-X lua_script:my.lua', then '-X lua_script1:foo' will pass the string 'foo' to the 'my.lua' script. If two scripts were loaded, such as '-X lua_script:my.lua' and '-X lua_script:other.lua' in that order, then a '-X lua_script2:bar' would pass the string 'bar' to the second lua script, namely 'other.lua'.
So you have one script file, loaded with with -X:lua_script:Gip.lua
, so this is script number 1 and both arguments should be in the from of -X lua_script1:argxxx
.
There is however simpler method of determining if the script is being run with Wireshark or not, gui_enabled().
2 | No.2 Revision |
I don't think this follows the rules for passing arguments to a lua script. From the tshark man page:
lua_script:lua_script_filename tells TShark to load the given script in addition to the default Lua scripts.
lua_scriptnum:argument tells TShark to pass the given argument to the lua script identified by 'num', which is the number indexed order of the 'lua_script' command. For example, if only one script was loaded with '-X lua_script:my.lua', then '-X lua_script1:foo' will pass the string 'foo' to the 'my.lua' script. If two scripts were loaded, such as '-X lua_script:my.lua' and '-X lua_script:other.lua' in that order, then a '-X lua_script2:bar' would pass the string 'bar' to the second lua script, namely 'other.lua'.
So you have one script file, loaded with with -X:lua_script:Gip.lua
, so this is script number 1 and both arguments should be in the from form of -X lua_script1:argxxx
.
There is however simpler method of determining if the script is being run with Wireshark or not, gui_enabled().