SHARKD(1)
π SHARKD(1) π
okay so bestie, welcome to SHARKD(1) β the manual page for sharkd, the daemon version of Wireshark that speaks JSON. this is part 1, so like, hydrate and get comfy π
β¨ NAME β¨
sharkd β dump and analyze network traffic interactively, but make it JSON-RPC π¦
β¨ SYNOPSIS β¨
sharkd [ -a|--api <socket> ] [ --foreground ]
[ -C|--config-profile <configuration profile> ]
sharkd -
sharkd -h|--help
sharkd -v|--version
β¨ DESCRIPTION β¨
so sharkd is literally the daemon-flavored variant of Wireshark, and it hands you a JSON-based API for doing network protocol analysis. it runs on the same dissection engine as Wireshark and TShark, which means you get programmatic access to packet dissection, filtering, and analysis. no cap, it's the same brain, just a different vibe π₯
sharkd can live in two modes: console mode and daemon mode.
- In console mode,
sharkdreads JSON-RPC requests from standard input and writes responses to standard output. you activate this by passing-as the argument, or by just runningsharkdwithout the-aoption. main character energy, no socket needed β¨ - In daemon mode,
sharkdlistens on a Unix domain socket or a TCP socket for incoming connections, and forks a new session process for each client. you activate this by passing the-aoption with a socket specification π
Requests and responses are encoded as JSON objects, one per line. peep the JSON-RPC METHODS section below for the complete list of method calls π
for full details on the JSON-RPC API, see https://wiki.wireshark.org/Development/sharkd.
β οΈ Warning βsharkdshould not be exposed to untrusted users. Unfiltered access tosharkdcould potentially result in information disclosure or arbitrary command execution. like, genuinely, do not do this. i'm serious π keep it locked down.
πΈ OPTIONS πΈ
-a <socket>,--api <socket>β listen on the specified socket for incoming client connections instead of reading from the console. when you use this option,sharkdruns as a daemon and forks a new session process for each client connection π§
Supported socket types:
unix:pathβ listen on a Unix domain socket at path. for example,unix:/tmp/sharkd.sock. on Linux, abstract sockets are supported by prefixing the name with@, for exampleunix:@sharkd; abstract sockets only support connections from peers with the same effective UID. Unix domain sockets are available on Windows 10 version 1803 and later, including Windows Server 2019 πtcp:address:portβ listen on a TCP socket bound to address on port. for example,tcp:127.0.0.1:4446. for IPv6 addresses, enclose the address in square brackets, e.g.tcp:[[::1]:5678. for security reasons, TCP sockets are only available on Windows builds by default, and only loopback addresses are supported, i.e. an IPv4 address in the127.0.0.0/8address space or the::1IPv6 loopback address π
If no -a option is provided, or if sharkd - is used, sharkd will accept commands via the console (standard input) π«Ά
--foregroundβ when running in daemon mode, do not detach from the controlling terminal. by default,sharkdforks into the background when a socket is specified with the-aoption. perfect for when you wanna keep an eye on it π-C <configuration profile>,--config-profile <configuration profile>β start with the specified configuration profile π-h,--helpβ print the version number and options and exit. the classic escape hatch π«-v,--versionβ print the full version information and exit β
π©Ί DIAGNOSTIC OPTIONS π©Ί
--log-level <level>β set the active log level. supported levels, in lowest to highest order, are"noisy","debug","info","message","warning","critical", and"error". messages at each level and higher will be printed β for example,"warning"prints"warning","critical", and"error"messages, and"noisy"prints all messages. levels are case insensitive π--log-fatal <level>β abort the program if any messages are logged at the specified level or higher. for example,"warning"aborts on any"warning","critical", or"error"messages π--log-fatal-count <count>β the amount of fatal log messages which may pass before the program is aborted π--log-domains <list>β only print messages for the specified log domains, e.g."GUI,Epan,sshdump". the list of domains must be comma-separated. can be negated with"!"as the first character (inverts the match) π--log-debug <list>β force the specified domains to log at the"debug"level. the list of domains must be comma-separated. can be negated with"!"as the first character (inverts the match) π¦--log-noisy <list>β force the specified domains to log at the"noisy"level. the list of domains must be comma-separated. can be negated with"!"as the first character (inverts the match) πΈ--log-fatal-domains <list>β abort the program if any messages are logged for the specified log domains. the list of domains must be comma-separated π€--log-file <path>β write log messages and stderr output to the specified file π
π JSON-RPC METHODS π
sharkd accepts newline-delimited JSON-RPC requests. every single request must include a jsonrpc field set to "2.0", a method field, and an id field. the following methods are supported, bestie:
analyseβ analyse the loaded capture file and return summary information β¨byeβ terminate the session πcheckβ check or compile a display filter πcompleteβ provide field name completion suggestions πdownloadβ download captured data or reassembled objects β¬οΈdumpconfβ dump current preference values ποΈfieldβ get information about a specific display filter field π―fieldsβ list all available display filter fields πfollowβ follow a stream (TCP, UDP, HTTP, etc.) π§΅frameβ get detailed information about a specific frame πΌοΈframesβ get a list of frames (packets) from the loaded capture file π¦infoβ get information about available dissectors, taps, and statistics βΉοΈintervalsβ get frame interval data for the loaded capture file β±οΈiographβ get I/O graph data for the loaded capture file πloadβ load a capture file for analysis πsetcommentβ set a comment on a specific frame π¬setconfβ set a Wireshark preference value βοΈstatusβ get the status of the currently loaded capture file π¦tapβ run a tap on the loaded capture file π°
π EXAMPLES π
to run sharkd in console mode:
sharkd -
to run sharkd as a daemon listening on a Unix domain socket:
sharkd -a unix:/tmp/sharkd.sock
to run sharkd as a daemon with a specific configuration profile:
sharkd -a unix:/tmp/sharkd.sock -C myprofile
to keep the daemon in the foreground for debugging:
sharkd -a unix:/tmp/sharkd.sock --foreground
an example console session, loading a file and getting its status:
$ echo '{"jsonrpc":"2.0","id":1,"method":"load","params":{"file":"/path/to/capture.pcapng"}}' | sharkd -
$ echo '{"jsonrpc":"2.0","id":2,"method":"status"}' | sharkd -
and that's a wrap on part 1, babes π more is coming, don't go anywhere π«Ά
πΈ ENVIRONMENT VARIABLES πΈ
Okay bestie, these are the lil knobs you can flip in your shell before you even launch sharkd. Set them, export them, live your truth β¨
WIRESHARK_CONFIG_DIRβ this one overrides where your personal config files live. On UNIX-compatible systems (Linux, macOS,*BSD, Solaris, and AIX), it defaults to$XDG_CONFIG_HOME/wiresharkβ or, if that directory doesn't exist but$HOME/.wiresharkdoes exist, then$HOME/.wireshark. Which is typically$HOME/.config/wireshark. On Windows it defaults to%APPDATA%\Wireshark(or, if%APPDATA%isn't defined,%USERPROFILE%\Application Data\Wireshark). Available since Wireshark 3.0. ποΈWIRESHARK_DEBUG_WMEM_OVERRIDEβ set this and you force the wmem framework to use whatever allocator backend you name, for all allocations, no matter which backend the code normally asked for. Basically a dev-only toy for testing and debugging. SeeREADME.wmemin the source distribution for the deets. π§ͺWIRESHARK_RUN_FROM_BUILD_DIRECTORYβ this makes plugins and other data files load from the build directory (the place where the program got compiled) instead of the standard locations. It does nothing when the program in question is running with root (or setuid) permissions on UNIX-compatible systems such as Linux, macOS,*BSD, Solaris, and AIX. ποΈWIRESHARK_DATA_DIRβ makes all the various data files load from a directory that isn't the standard locations. Again, zero effect when the program is running with root (or setuid) permissions on UNIX-compatible systems. πWIRESHARK_EXTCAP_DIRβ makes the various extcap programs and scripts run from a directory other than the standard locations. Same deal: no effect when running with root (or setuid) permissions on UNIX-compatible systems. πWIRESHARK_PLUGIN_DIRβ makes the various plugins load from a directory other than the standard locations. And yes, no effect when running with root (or setuid) permissions on UNIX-compatible systems. π§©ERF_RECORDS_TO_CHECKβ controls how many ERF records get checked when deciding if a file really is in ERF format. Set it higher than the default (20) and false positives become less likely. π΅οΈββοΈIPFIX_RECORDS_TO_CHECKβ same energy but for IPFIX: controls how many IPFIX records get checked when deciding if a file really is in IPFIX format. Higher than the default (20) = fewer false positives. π―WIRESHARK_ABORT_ON_DISSECTOR_BUGβ set this and TShark will callabort(3)the moment a dissector bug shows up.abort(3)makes the program exit abnormally; if you've got TShark running in a debugger it should halt right there in the debugger so you can inspect the process, and if you're not in a debugger it'll generate a core dump file on some OSes (assuming your environment is configured correctly). Super useful for devs troubleshooting a protocol dissector problem. π₯WIRESHARK_ABORT_ON_TOO_MANY_ITEMSβ set this and TShark callsabort(3)if a dissector tries to add too many items to a tree (which generally means the dissector didn't break out of a loop soon enough). Sameabort(3)behaviour: abnormal exit, halts in the debugger if you're running under one, and on some OSes β assuming your environment is configured correctly β generates a core dump file. Also great for devs troubleshooting a protocol dissector. πWIRESHARK_LOG_LEVELβ controls how chatty the diagnostic messages to the console are. From least to most verbose, the levels arecritical,warning,message,info,debug, ornoisy. Levels above the current level are also active. Levelscriticalanderrorare always active. π£οΈWIRESHARK_LOG_FATALβ sets the fatal log level. Fatal log levels cause the program to abort. This level can be set toError,critical, orwarning.Erroris always fatal and is the default. β οΈWIRESHARK_LOG_DOMAINSβ picks which log domains are active. The filter is a case-insensitive comma separated list. If it's set, only the included domains get enabled. The default domain is always considered enabled. Domain filter lists can be preceded by!to invert the sense of the match. πWIRESHARK_LOG_DEBUGβ a list of domains withdebuglog level. This sets the level of the provided log domains and takes precedence over the active domains filter. Preceded by!? Then it disables the debug level instead. πWIRESHARK_LOG_NOISYβ literally the same as above but for thenoisylog level instead. π’
π SEE ALSO π
Go read these too, they're the whole friend group π
wireshark-filter(4), wireshark(1), editcap(1), pcap(3), dumpcap(1), text2pcap(1), mergecap(1), pcap-filter(7) or tcpdump(8)
π NOTES π
This is the manual page for Sharkd 4.7.4. Sharkd is part of the Wireshark distribution. The latest version of Wireshark can be found at https://www.wireshark.org. π
HTML versions of the Wireshark project man pages are available at https://www.wireshark.org/docs/man-pages. π«Ά
π AUTHORS π
Sharkd was written by Jakub Zawadzki. Sharkd uses the same packet dissection code that Wireshark does, as well as using many other modules from Wireshark; see the list of authors in the Wireshark man page for a list of authors of that code. β¨
And that's the whole page, bestie!! π This beauty is Sharkd 4.7.4, dated 2026-10-08, and it ate, no cap. Go dissect something iconic π π₯
π¦ where this page comes from
- arch rolling: wireshark-cli 4.7.4-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms