slinktool – SeedLink client for data stream inspection, data collection and server testing
slinktool [options] [host][:][port]
slinktool connects to a SeedLink server and queries the server for information or requests data using uni-station or multi-station mode and prints information about the packets received. All received packets can optionally be dumped to a single file or saved in custom directory and file layouts.
||Report program version and exit.|
||Print program usage and exit.|
||Be more verbose. This flag can be used multiple times (
One flag: report basic handshaking (link configuration) details and briefly report each packet received.
Two flags: report the details of the handshaking, each packet received and detailed connection diagnostics.
||Ping the server: connect, print out the server ID and exit. If the server was successfully contacted the return code will be 0, if errors were encountered the return code will be 1.|
||Print details of received Mini-SEED data records. This flag can be used multiple times (
One flag: a single summary line for each data packet received.
Two flags: details of the Mini-SEED data records received, including information from fixed header and 100/1000/1001 blockettes.
||Print data samples in data packets, implies at least one
||The network reconnect delay (in seconds) for the connection to the SeedLink server. If the connection breaks for any reason this will govern how soon a reconnection should be attempted. The default value is 30 seconds.|
||The network timeout (in seconds) for the connection to the SeedLink server. If no data [or keep alive packets?] are received in this time the connection is closed and re-established (after the reconnect delay has expired). The default value is 600 seconds. A value of 0 disables the timeout.|
||Requires SeedLink >= 3
Keepalive packet interval (in seconds) at which keepalive (heartbeat) packets are sent to the server. Keepalive packets are only sent if nothing is received within the interval.
||During client shutdown the last received sequence numbers and time stamps (start times) for each data stream will be saved in this file. If this file exists upon startup the information will be used to resume the data streams from the point at which they were stopped. In this way the client can be stopped and started without data loss, assuming the data are still available on the server. If interval is specified the state will be saved every interval packets that are received. Otherwise the state will be saved only on normal program termination.|
||Configure the connection in dial-up mode. The remote server will close the connection when it has sent all of the data in it’s buffers for the selected data streams. This is opposed to the normal behavior of waiting indefinately for data.|
||Configure the connection in batch mode. Negotiation with the remote server is made faster by minimizing acknowledgement checks.|
||If specified, all packets (Mini-SEED records) received will be appended to this file. The file is created if it does not exist. A special mode for this option is to send all received packets to standard output when the dumpfile is specified as
||If specified, all packets (Mini-SEED records) received will be appended to a directory/file structure defined by format. All directories implied in the format string will be created if necessary. See the section Archiving data.|
||If specified, all packets (Mini-SEED records) received will be saved into a Simple Data Structure (SDS) dir/file structure starting at the specified directory. This directory and all subdirectories will be created if necessary. This option is esentially a preset version of
||If specified, all waveform data packets (Mini-SEED data records) received will be saved into a Buffer of Uniform Data (BUD) dir/file structure starting at the specified directory. This directory and all subdirectories will be created if necessary. This option is essentially a preset version of
||This defines default selectors. If no multi-station data streams are configured these selectors will be used for uni-station mode. Otherwise these selectors will be used when no selectors are specified for a given stream using the
||A list of streams will be read from the given file. This option implies multi-station mode. The format of the stream list file is given below in the section Stream list file.|
||Requires SeedLink >= 2.5
A list of streams is given as an argument. This option implies multi-station mode. The stream list is composed of multiple streams (stations) and optional selectors.
||Requires SeedLink >= 3
Specifies a time window applied, by the server, to data streams. The format for both times is
Warning: time windowing might be disabled on the remote server.
||Requires SeedLink >= 3
Send an information request (
*Warning: informational (
||A required argument, specifies the address of the SeedLink server in
All-station/Uni-station mode example ¶
The following would connect to a SeedLink server at slink.host.com port 18000 and configure the link in all-station/uni-station mode, exactly which data are received depends on the data being served by the SeedLink server on that particular port. Additionally, all of the received packets are appended to the file
data.mseed and each packet received is reported on the standard output.
>slinktool -v -o data.mseed slink.host.com:18000
-s argument could be used to indicate selectors to limit the type of packets sent by the SeedLink server (without selectors all packet types are sent). The following would limit this connection to
BHZ channel waveform data with a location code of
10 (see an explanation of SeedLink selectors below). Additionally another verbose flag is given, causing slinktool to report detailed header information from data records.
>slinktool -vv -s 10BHZ.D -o data.mseed slink.host.com:18000
Multi-station mode example: ¶
The following example would connect to a SeedLink server on localhost port 18010 and configure the link in multi-station mode. Each station specified with the
-S argument will be requested, optionally specifying selectors for each station.
>slinktool -v -S GE_WLF,MN_AQU:00???,IU_KONO:BHZ.D :18010
This would request GEOFON station WLF (all data as no selectors were indicated), MedNet station AQU with location code 00 (all channels) and IU network station KONO (only waveform data) from channel BHZ.
Of course, a variety of different data selections can be made (only one
-s 'BHE.D BHN.D' -S 'GE_STU,GE_MALT,GE_WLF'
(horizontal BH channels, data only)
-s BHZ -S GE_STU,GE_WLF,GE_RUE,GE_EIL
(vertical channels only)
Wildcarding network and station codes ¶
Some SeedLink implementation support wildcarding of the network and station codes, when this is the case the only two wildcard characters recognized are
* for one or more characters and
? for any single character. As an example, all US network data can be requested using the following syntax:
-B -S 'US_*
SeedLink SELECTORS ¶
SeedLink selectors are used to request specific types of data within a given data stream, in effect limiting the default action of sending all data types. A data packet is sent to the client if it matches any positive selector (without leading
!) and doesn’t match any negative selectors (with a leading
!). The general format of selectors is
LL is location,
SSS is channel and
T is type (one of
LLSSS. can be omitted, implying anything in that field. It is also possible to use
? in place of
S as a single character wildcard. Multiple selectors are separated by space(s).
||BHZ, BHN, BHE (all record types)|
||BHZ, BHN, BHE with location code ‘00’ (data records)|
||BHZ, BHN, BHE (excluding detection records)|
||BHZ, BHN, BHE & detection records of all channels|
||exclude LCQ and LEP channels|
||exclude log and timing records|
Archiving data ¶
-A format option received data can be saved in a custom directory and file structure. The archive format argument is expanded for each packet processed using the following flags:
||network code, white space removed|
||station code, white space removed|
||location code, white space removed|
||channel code, white space removed|
||year, 4 digits|
||year, 2 digits zero padded|
||day of year, 3 digits zero padded|
||hour, 2 digits zero padded|
||minute, 2 digits zero padded|
||second, 2 digits zero padded|
||fractional seconds, 4 digits zero padded|
||the percent (%) character|
||the number (#) character|
||single character type code:
The flags are prefaced with either the
# modifier. The
% modifier indicates a defining flag while the
# indicates a non-defining flag. All received packets with the same set of defining flags will be saved to the same file. Non-defining flags will be expanded using the values in the first packet received for the resulting file name.
Time flags are based on the start time of the given packet.
For example, the format string:
would be expanded to day length files named something like:
Using non-defining flags the format string:
would be expanded to:
resulting in hour length files because the minute and second are specified with the non-defining modifier. The minute and second fields are from the first packet in the file.
Stream list file ¶
The stream list file used with the
-l option is expected to define a data stream on each line. The format of each line is:
<net> <station> [selectors]
The selectors are optional. If default selectors are also specified (with the
-s option), they they will be used when no selectors are specified for a given stream. An example file follows:
---- Begin example file ----- # Comment lines begin with a '#' or '*' # Example stream list file for use with the -l argument of slclient or # with the sl_read_streamlist() libslink function. GE ISP BH?.D NL HGN MN AQU BH? HH? ---- End example file -----
All diagnostic output from
slinktool is printed to standard error (
stderr), exceptions are when printing Mini-SEED packet details (the
-p flag), when printing unpacked samples (the
-u flag) and when printing the raw or formatted responses to
SeedLink is currently distributed as part of the SeisComP package. For more information see, http://www.gfz-potsdam.de/geofon/