A CLI tool for importing JSON-formatted log files directly into Seq.
seq-import: Import JSON log files into Seq.
Usage:
seq-import.exe <file> <server> [--apikey=<k>] [--p:<key>=<value>]
seq-import.exe (-h | --help)
Options:
-h --help Show this screen.
<file> The file to import.
<server> The Seq server URL.
--apikey=<k> Seq API key.
--p:<key>=<value> Add tag(s) to import.
Example:
seq-import.exe myapp.json https://my-seq --apikey=jhfaty89thfajkafhkl
The command will print a GUID ImportId
, which will also be attached to the imported events in Seq.
seq-import.exe myapp.json https://my-seq --p:user=myappuser1 --p:email=myappuser@email.com
The command will attach the following tags: user
and email
to all imported events in Seq.
Requires .NET 4.5 or better.
With Chocolatey:
choco install seq-import
Or, download a zip file of the source code and build/run locally.
Newline-separated JSON is the only format currently supported. The fields are:
Timestamp
- an ISO 8601 timestamp with optional timezoneLevel
- (optional) eitherVerbose
,Debug
,Information
,Warning
,Error
,Fatal
MessageTemplate
- a Serilog-compatible message templateProperties
(optional) - a dictionary of property valuesRenderings
(optional) - a dictionary of programming-language-specific formattings of properties that appear in the message template
The import tool uses Serilog's canonical JSON format. To create a file in this format, either:
- Specify a
Serilog.Formatting.Json.JsonFormatter
as theITextFormatter
for a log event sink; or, - Use a sink from Serilog.Sinks.Json.