Hello All, I would like to set a protocol as a default display filter forever instead of always writing the protocol name in the Filter combo box whenever I open Wireshark. I'd like to hard-code it so that it remains forvever as my setting. Kindly, Provide the solution. Thanks, Regards, S.Prashanth. This question is marked "community wiki". asked 20 Sep '11, 19:43 Terrestrial ... edited 27 Sep '11, 06:47 helloworld |
3 Answers:
Thanks all. I have resolved it by backporting the
This answer is marked “community wiki”. answered 28 Sep ‘11, 00:00 Terrestrial … edited 28 Sep ‘11, 05:24 helloworld |
Find the place where lua scripts should go and create the following 3 files. init.lua must have the same name. Others can be renamed. Last file is where you can customize your default filter.
answered 26 Sep ‘11, 05:55 Hiftu showing 5 of 6 show 1 more comments |
Wireshark doesn't have a way to set a default display filter. I suggest filing an enhancement request (or providing a patch to implement this functionality) at bugs.wireshark.org . Note that although there is a answered 20 Sep '11, 20:33 Bill Meier ♦♦ edited 20 Sep '11, 20:34 1 An update: Thanks to Stig, as of r39090, which closes bug 2463, Wireshark now takes a (26 Sep '11, 18:24) cmaynard ♦♦ |
There’s a few problems with this solution:
1) In this case, you don’t need
init.lua
(or even three files…a single file suffices, but “to each his own”).2) All Lua scripts are loaded automatically if they’re in any of the
plugins
directories (or their subdirectories). So, your use ofdofile(‘xyz’)
while the‘xyz’
file is underplugins
causes the file to be loaded twice. In your example, this creates two taps that do the same thing. Harmless here, but the bug makes this a bad example.Sorry, I am a linux user. I had to add init.lua in my system. I like splitting the config and the script so it is easy to modify even with little knowledge in lua scripting.
This isn’t required in Ubuntu 11.04. Which flavor (and specific version) of Linux are you running?
When the config and script are so short (as in this case), there’s little advantage in splitting the files. Even if you wanted to organize your files this way, you should rename the config file extension to something other than
.lua
in order to prevent Wireshark Lua from auto-loading it in addition to your explicitdofile()
. Another way to prevent the auto-load is to move the file outside of theplugins
directories.Oh, I currently use the ~/.wireshark directory. Where is the plugin directory? (I work in enterprise environment , and I haven’t got root access. BTW it is SLED10.)
The
plugins
directories are listed in the manual (Table A.1 Configuration files and folders). Your personal plugins (Lua in this case) would be in~/.wireshark/plugins
(you might need to create the subdirectory).