Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Build.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
$ErrorActionPreference = 'Stop'

function Clean-Output
{
if(Test-Path ./artifacts) { rm ./artifacts -Force -Recurse }
}

function Restore-Packages
{
& dotnet restore
}

function Execute-Tests
{
& dotnet test ./test/SeqCli.Tests/SeqCli.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 3 }
}

function Create-ArtifactDir
{
mkdir ./artifacts
}

function Publish-Gzips($version)
{
$rids = @("linux-x64", "osx-x64")
foreach ($rid in $rids) {
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r $rid /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 4 }

# Make sure the archive contains a reasonable root filename
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/

& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

# Back to the original directory name
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/

& ./build/7-zip/7za.exe a -tgzip ./artifacts/seqcli-$version-$rid.tar.gz seqcli-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }

rm seqcli-$version-$rid.tar
}
}

function Publish-Msi($version)
{
& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r win-x64 /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 7 }

& msbuild ./setup/SeqCli.Setup/SeqCli.Setup.wixproj /t:Build /p:Configuration=Release /p:Platform=x64 /p:Version=$version /p:BuildProjectReferences=false
if($LASTEXITCODE -ne 0) { exit 8 }

mv ./setup/SeqCli.Setup/bin/Release/seqcli.msi ./artifacts/seqcli-$version.msi
}

Push-Location $PSScriptRoot

$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
Write-Output "Building version $version"

Clean-Output
Create-ArtifactDir
Restore-Packages
Publish-Msi($version)
Publish-Gzips($version)
Execute-Tests

Pop-Location
4 changes: 2 additions & 2 deletions LICENSE
Original file line numberDiff line numberDiff line change
Expand Up@@ -178,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
143 changes: 141 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,141 @@
# seqcli
Seq client command-line
# `seqcli` [![Build status](https://ci.appveyor.com/api/projects/status/sc3iacxwxqqfjgdh?svg=true)](https://ci.appveyor.com/project/datalust/seqcli) [![GitHub release](https://img.shields.io/github/release/datalust/seqcli.svg)](https://github.com/datalust/seqcli/releases)

The [Seq](https://getseq.net) client command-line app. Supports logging (`seqcli log`), searching (`search`), tailing (`tail`), querying (`query`) and [JSON log file](https://github.com/serilog/serilog-formatting-compact) ingestion (`ingest`).

![SeqCli Screenshot](https://raw.githubusercontent.com/datalust/seqcli/dev/asset/SeqCli.png)

## Getting started

Install or unzip the [release for your operating system](https://github.com/datalust/seqcli/releases).

To set a default server URL, run:

```
seqcli config -k connection.serverUrl -v https://your-seq-server
```

This will create `SeqConfig.json` in your home directory. A default API key can also be set by providing the `connection.apiKey` setting name.

## Commands

Usage:

```
seqcli <command> [<args>]
```

### `config`

View and set fields in the `SeqCli.json` file; run with no arguments to list all fields.

| Option | Description |
| ------ | ----------- |
| `-k`, `--key=VALUE` | The field, for example `connection.serverUrl` |
| `-v`, `--value=VALUE` | The field value; if not specified, the command will print the current value |
| `-c`, `--clear` | Clear the field |

### `help`

Show information about available commands.

| Option | Description |
| ------ | ----------- |
| `-m`, `--markdown` | Generate markdown for use in documentation |

### `ingest`

Send JSON log events from a file or `STDIN`.

Example:

```
seqcli ingest -i events.clef --filter="@Level <> 'Debug'" -p Environment=Test
```

| Option | Description |
| ------ | ----------- |
| `-i`, `--input=VALUE` | CLEF file to ingest; if not specified, `STDIN` will be used |
| `--invalid-data=VALUE` | Specify how invalid data is handled: fail (default) or ignore |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-f`, `--filter=VALUE` | Filter expression to select a subset of events |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `log`

Send a structured log event to the server.

Example:

```
seqcli log -m 'Hello, {Name}!' -p Name=World -p App=Test
```

| Option | Description |
| ------ | ----------- |
| `-m`, `--message=VALUE` | A message to associate with the event (the default is to send no message); https://messagetemplates.org syntax is supported |
| `-l`, `--level=VALUE` | The level or severity of the event (the default is `Information`) |
| `-t`, `--timestamp=VALUE` | The event timestamp as ISO-8601 (the current UTC timestamp will be used by default) |
| `-x`, `--exception=VALUE` | Additional exception or error information to send, if any |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `query`

Execute an SQL query and receive results in CSV format.

Example:

```
seqcli query -q "select count(*) from stream group by @Level" --start="2018-02-28T13:00Z"
```

| Option | Description |
| ------ | ----------- |
| `-q`, `--query=VALUE` | The query to execute |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `--timeout=VALUE` | The query execution timeout in milliseconds |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `search`

Retrieve log events that match a given filter.

Example:

```
seqcli search -f "@Exception like '%TimeoutException%'" -c 30
```

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | A filter to apply to the search, for example `Host = 'xmpweb-01.example.com'` |
| `-c`, `--count=VALUE` | The maximum number of events to retrieve; the default is 1 |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `tail`

Stream log events matching a filter.

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | An optional server-side filter to apply to the stream, for example `@Level = 'Error'` |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `version`

Print the current executable version.
17 changes: 17 additions & 0 deletions appveyor.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
version: 0.1.{build}
skip_tags: true
image: Visual Studio 2017
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/seqcli-*.msi
- path: artifacts/seqcli-*.tar.gz
deploy:
- provider: GitHub
auth_token:
secure: Bo3ypKpKFxinjR9ShkNekNvkob2iklHJU+UlYyfHtcFFIAa58SV2TkEd0xWxz633
artifact: /seqcli-.*\.(msi|tar\.gz)/
tag: v$(appveyor_build_version)
on:
branch: master
Binary file addedasset/SeqCli-Icon-128px.ico
Binary file not shown.
Binary file addedasset/SeqCli-Icon-128px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions asset/SeqCli-Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedasset/SeqCli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Build.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
$ErrorActionPreference = 'Stop'

function Clean-Output
{
if(Test-Path ./artifacts) { rm ./artifacts -Force -Recurse }
}

function Restore-Packages
{
& dotnet restore
}

function Execute-Tests
{
& dotnet test ./test/SeqCli.Tests/SeqCli.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 3 }
}

function Create-ArtifactDir
{
mkdir ./artifacts
}

function Publish-Gzips($version)
{
$rids = @("linux-x64", "osx-x64")
foreach ($rid in $rids) {
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r $rid /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 4 }

# Make sure the archive contains a reasonable root filename
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/

& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

# Back to the original directory name
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/

& ./build/7-zip/7za.exe a -tgzip ./artifacts/seqcli-$version-$rid.tar.gz seqcli-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }

rm seqcli-$version-$rid.tar
}
}

function Publish-Msi($version)
{
& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r win-x64 /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 7 }

& msbuild ./setup/SeqCli.Setup/SeqCli.Setup.wixproj /t:Build /p:Configuration=Release /p:Platform=x64 /p:Version=$version /p:BuildProjectReferences=false
if($LASTEXITCODE -ne 0) { exit 8 }

mv ./setup/SeqCli.Setup/bin/Release/seqcli.msi ./artifacts/seqcli-$version.msi
}

Push-Location $PSScriptRoot

$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
Write-Output "Building version $version"

Clean-Output
Create-ArtifactDir
Restore-Packages
Publish-Msi($version)
Publish-Gzips($version)
Execute-Tests

Pop-Location
4 changes: 2 additions & 2 deletions LICENSE
Original file line numberDiff line numberDiff line change
Expand Up@@ -178,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
143 changes: 141 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,141 @@
# seqcli
Seq client command-line
# `seqcli` [![Build status](https://ci.appveyor.com/api/projects/status/sc3iacxwxqqfjgdh?svg=true)](https://ci.appveyor.com/project/datalust/seqcli) [![GitHub release](https://img.shields.io/github/release/datalust/seqcli.svg)](https://github.com/datalust/seqcli/releases)

The [Seq](https://getseq.net) client command-line app. Supports logging (`seqcli log`), searching (`search`), tailing (`tail`), querying (`query`) and [JSON log file](https://github.com/serilog/serilog-formatting-compact) ingestion (`ingest`).

![SeqCli Screenshot](https://raw.githubusercontent.com/datalust/seqcli/dev/asset/SeqCli.png)

## Getting started

Install or unzip the [release for your operating system](https://github.com/datalust/seqcli/releases).

To set a default server URL, run:

```
seqcli config -k connection.serverUrl -v https://your-seq-server
```

This will create `SeqConfig.json` in your home directory. A default API key can also be set by providing the `connection.apiKey` setting name.

## Commands

Usage:

```
seqcli <command> [<args>]
```

### `config`

View and set fields in the `SeqCli.json` file; run with no arguments to list all fields.

| Option | Description |
| ------ | ----------- |
| `-k`, `--key=VALUE` | The field, for example `connection.serverUrl` |
| `-v`, `--value=VALUE` | The field value; if not specified, the command will print the current value |
| `-c`, `--clear` | Clear the field |

### `help`

Show information about available commands.

| Option | Description |
| ------ | ----------- |
| `-m`, `--markdown` | Generate markdown for use in documentation |

### `ingest`

Send JSON log events from a file or `STDIN`.

Example:

```
seqcli ingest -i events.clef --filter="@Level <> 'Debug'" -p Environment=Test
```

| Option | Description |
| ------ | ----------- |
| `-i`, `--input=VALUE` | CLEF file to ingest; if not specified, `STDIN` will be used |
| `--invalid-data=VALUE` | Specify how invalid data is handled: fail (default) or ignore |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-f`, `--filter=VALUE` | Filter expression to select a subset of events |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `log`

Send a structured log event to the server.

Example:

```
seqcli log -m 'Hello, {Name}!' -p Name=World -p App=Test
```

| Option | Description |
| ------ | ----------- |
| `-m`, `--message=VALUE` | A message to associate with the event (the default is to send no message); https://messagetemplates.org syntax is supported |
| `-l`, `--level=VALUE` | The level or severity of the event (the default is `Information`) |
| `-t`, `--timestamp=VALUE` | The event timestamp as ISO-8601 (the current UTC timestamp will be used by default) |
| `-x`, `--exception=VALUE` | Additional exception or error information to send, if any |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `query`

Execute an SQL query and receive results in CSV format.

Example:

```
seqcli query -q "select count(*) from stream group by @Level" --start="2018-02-28T13:00Z"
```

| Option | Description |
| ------ | ----------- |
| `-q`, `--query=VALUE` | The query to execute |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `--timeout=VALUE` | The query execution timeout in milliseconds |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `search`

Retrieve log events that match a given filter.

Example:

```
seqcli search -f "@Exception like '%TimeoutException%'" -c 30
```

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | A filter to apply to the search, for example `Host = 'xmpweb-01.example.com'` |
| `-c`, `--count=VALUE` | The maximum number of events to retrieve; the default is 1 |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `tail`

Stream log events matching a filter.

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | An optional server-side filter to apply to the stream, for example `@Level = 'Error'` |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `version`

Print the current executable version.
17 changes: 17 additions & 0 deletions appveyor.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
version: 0.1.{build}
skip_tags: true
image: Visual Studio 2017
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/seqcli-*.msi
- path: artifacts/seqcli-*.tar.gz
deploy:
- provider: GitHub
auth_token:
secure: Bo3ypKpKFxinjR9ShkNekNvkob2iklHJU+UlYyfHtcFFIAa58SV2TkEd0xWxz633
artifact: /seqcli-.*\.(msi|tar\.gz)/
tag: v$(appveyor_build_version)
on:
branch: master
Binary file addedasset/SeqCli-Icon-128px.ico
Binary file not shown.
Binary file addedasset/SeqCli-Icon-128px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions asset/SeqCli-Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedasset/SeqCli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Build.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
$ErrorActionPreference = 'Stop'

function Clean-Output
{
if(Test-Path ./artifacts) { rm ./artifacts -Force -Recurse }
}

function Restore-Packages
{
& dotnet restore
}

function Execute-Tests
{
& dotnet test ./test/SeqCli.Tests/SeqCli.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 3 }
}

function Create-ArtifactDir
{
mkdir ./artifacts
}

function Publish-Gzips($version)
{
$rids = @("linux-x64", "osx-x64")
foreach ($rid in $rids) {
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r $rid /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 4 }

# Make sure the archive contains a reasonable root filename
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/

& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

# Back to the original directory name
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/

& ./build/7-zip/7za.exe a -tgzip ./artifacts/seqcli-$version-$rid.tar.gz seqcli-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }

rm seqcli-$version-$rid.tar
}
}

function Publish-Msi($version)
{
& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r win-x64 /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 7 }

& msbuild ./setup/SeqCli.Setup/SeqCli.Setup.wixproj /t:Build /p:Configuration=Release /p:Platform=x64 /p:Version=$version /p:BuildProjectReferences=false
if($LASTEXITCODE -ne 0) { exit 8 }

mv ./setup/SeqCli.Setup/bin/Release/seqcli.msi ./artifacts/seqcli-$version.msi
}

Push-Location $PSScriptRoot

$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
Write-Output "Building version $version"

Clean-Output
Create-ArtifactDir
Restore-Packages
Publish-Msi($version)
Publish-Gzips($version)
Execute-Tests

Pop-Location
4 changes: 2 additions & 2 deletions LICENSE
Original file line numberDiff line numberDiff line change
Expand Up@@ -178,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
143 changes: 141 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,141 @@
# seqcli
Seq client command-line
# `seqcli` [![Build status](https://ci.appveyor.com/api/projects/status/sc3iacxwxqqfjgdh?svg=true)](https://ci.appveyor.com/project/datalust/seqcli) [![GitHub release](https://img.shields.io/github/release/datalust/seqcli.svg)](https://github.com/datalust/seqcli/releases)

The [Seq](https://getseq.net) client command-line app. Supports logging (`seqcli log`), searching (`search`), tailing (`tail`), querying (`query`) and [JSON log file](https://github.com/serilog/serilog-formatting-compact) ingestion (`ingest`).

![SeqCli Screenshot](https://raw.githubusercontent.com/datalust/seqcli/dev/asset/SeqCli.png)

## Getting started

Install or unzip the [release for your operating system](https://github.com/datalust/seqcli/releases).

To set a default server URL, run:

```
seqcli config -k connection.serverUrl -v https://your-seq-server
```

This will create `SeqConfig.json` in your home directory. A default API key can also be set by providing the `connection.apiKey` setting name.

## Commands

Usage:

```
seqcli <command> [<args>]
```

### `config`

View and set fields in the `SeqCli.json` file; run with no arguments to list all fields.

| Option | Description |
| ------ | ----------- |
| `-k`, `--key=VALUE` | The field, for example `connection.serverUrl` |
| `-v`, `--value=VALUE` | The field value; if not specified, the command will print the current value |
| `-c`, `--clear` | Clear the field |

### `help`

Show information about available commands.

| Option | Description |
| ------ | ----------- |
| `-m`, `--markdown` | Generate markdown for use in documentation |

### `ingest`

Send JSON log events from a file or `STDIN`.

Example:

```
seqcli ingest -i events.clef --filter="@Level <> 'Debug'" -p Environment=Test
```

| Option | Description |
| ------ | ----------- |
| `-i`, `--input=VALUE` | CLEF file to ingest; if not specified, `STDIN` will be used |
| `--invalid-data=VALUE` | Specify how invalid data is handled: fail (default) or ignore |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-f`, `--filter=VALUE` | Filter expression to select a subset of events |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `log`

Send a structured log event to the server.

Example:

```
seqcli log -m 'Hello, {Name}!' -p Name=World -p App=Test
```

| Option | Description |
| ------ | ----------- |
| `-m`, `--message=VALUE` | A message to associate with the event (the default is to send no message); https://messagetemplates.org syntax is supported |
| `-l`, `--level=VALUE` | The level or severity of the event (the default is `Information`) |
| `-t`, `--timestamp=VALUE` | The event timestamp as ISO-8601 (the current UTC timestamp will be used by default) |
| `-x`, `--exception=VALUE` | Additional exception or error information to send, if any |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `query`

Execute an SQL query and receive results in CSV format.

Example:

```
seqcli query -q "select count(*) from stream group by @Level" --start="2018-02-28T13:00Z"
```

| Option | Description |
| ------ | ----------- |
| `-q`, `--query=VALUE` | The query to execute |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `--timeout=VALUE` | The query execution timeout in milliseconds |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `search`

Retrieve log events that match a given filter.

Example:

```
seqcli search -f "@Exception like '%TimeoutException%'" -c 30
```

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | A filter to apply to the search, for example `Host = 'xmpweb-01.example.com'` |
| `-c`, `--count=VALUE` | The maximum number of events to retrieve; the default is 1 |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `tail`

Stream log events matching a filter.

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | An optional server-side filter to apply to the stream, for example `@Level = 'Error'` |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `version`

Print the current executable version.
17 changes: 17 additions & 0 deletions appveyor.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
version: 0.1.{build}
skip_tags: true
image: Visual Studio 2017
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/seqcli-*.msi
- path: artifacts/seqcli-*.tar.gz
deploy:
- provider: GitHub
auth_token:
secure: Bo3ypKpKFxinjR9ShkNekNvkob2iklHJU+UlYyfHtcFFIAa58SV2TkEd0xWxz633
artifact: /seqcli-.*\.(msi|tar\.gz)/
tag: v$(appveyor_build_version)
on:
branch: master
Binary file addedasset/SeqCli-Icon-128px.ico
Binary file not shown.
Binary file addedasset/SeqCli-Icon-128px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions asset/SeqCli-Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedasset/SeqCli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Build.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
$ErrorActionPreference = 'Stop'

function Clean-Output
{
if(Test-Path ./artifacts) { rm ./artifacts -Force -Recurse }
}

function Restore-Packages
{
& dotnet restore
}

function Execute-Tests
{
& dotnet test ./test/SeqCli.Tests/SeqCli.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 3 }
}

function Create-ArtifactDir
{
mkdir ./artifacts
}

function Publish-Gzips($version)
{
$rids = @("linux-x64", "osx-x64")
foreach ($rid in $rids) {
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r $rid /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 4 }

# Make sure the archive contains a reasonable root filename
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/

& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

# Back to the original directory name
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/

& ./build/7-zip/7za.exe a -tgzip ./artifacts/seqcli-$version-$rid.tar.gz seqcli-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }

rm seqcli-$version-$rid.tar
}
}

function Publish-Msi($version)
{
& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r win-x64 /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 7 }

& msbuild ./setup/SeqCli.Setup/SeqCli.Setup.wixproj /t:Build /p:Configuration=Release /p:Platform=x64 /p:Version=$version /p:BuildProjectReferences=false
if($LASTEXITCODE -ne 0) { exit 8 }

mv ./setup/SeqCli.Setup/bin/Release/seqcli.msi ./artifacts/seqcli-$version.msi
}

Push-Location $PSScriptRoot

$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
Write-Output "Building version $version"

Clean-Output
Create-ArtifactDir
Restore-Packages
Publish-Msi($version)
Publish-Gzips($version)
Execute-Tests

Pop-Location
4 changes: 2 additions & 2 deletions LICENSE
Original file line numberDiff line numberDiff line change
Expand Up@@ -178,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
143 changes: 141 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,141 @@
# seqcli
Seq client command-line
# `seqcli` [![Build status](https://ci.appveyor.com/api/projects/status/sc3iacxwxqqfjgdh?svg=true)](https://ci.appveyor.com/project/datalust/seqcli) [![GitHub release](https://img.shields.io/github/release/datalust/seqcli.svg)](https://github.com/datalust/seqcli/releases)

The [Seq](https://getseq.net) client command-line app. Supports logging (`seqcli log`), searching (`search`), tailing (`tail`), querying (`query`) and [JSON log file](https://github.com/serilog/serilog-formatting-compact) ingestion (`ingest`).

![SeqCli Screenshot](https://raw.githubusercontent.com/datalust/seqcli/dev/asset/SeqCli.png)

## Getting started

Install or unzip the [release for your operating system](https://github.com/datalust/seqcli/releases).

To set a default server URL, run:

```
seqcli config -k connection.serverUrl -v https://your-seq-server
```

This will create `SeqConfig.json` in your home directory. A default API key can also be set by providing the `connection.apiKey` setting name.

## Commands

Usage:

```
seqcli <command> [<args>]
```

### `config`

View and set fields in the `SeqCli.json` file; run with no arguments to list all fields.

| Option | Description |
| ------ | ----------- |
| `-k`, `--key=VALUE` | The field, for example `connection.serverUrl` |
| `-v`, `--value=VALUE` | The field value; if not specified, the command will print the current value |
| `-c`, `--clear` | Clear the field |

### `help`

Show information about available commands.

| Option | Description |
| ------ | ----------- |
| `-m`, `--markdown` | Generate markdown for use in documentation |

### `ingest`

Send JSON log events from a file or `STDIN`.

Example:

```
seqcli ingest -i events.clef --filter="@Level <> 'Debug'" -p Environment=Test
```

| Option | Description |
| ------ | ----------- |
| `-i`, `--input=VALUE` | CLEF file to ingest; if not specified, `STDIN` will be used |
| `--invalid-data=VALUE` | Specify how invalid data is handled: fail (default) or ignore |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-f`, `--filter=VALUE` | Filter expression to select a subset of events |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `log`

Send a structured log event to the server.

Example:

```
seqcli log -m 'Hello, {Name}!' -p Name=World -p App=Test
```

| Option | Description |
| ------ | ----------- |
| `-m`, `--message=VALUE` | A message to associate with the event (the default is to send no message); https://messagetemplates.org syntax is supported |
| `-l`, `--level=VALUE` | The level or severity of the event (the default is `Information`) |
| `-t`, `--timestamp=VALUE` | The event timestamp as ISO-8601 (the current UTC timestamp will be used by default) |
| `-x`, `--exception=VALUE` | Additional exception or error information to send, if any |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `query`

Execute an SQL query and receive results in CSV format.

Example:

```
seqcli query -q "select count(*) from stream group by @Level" --start="2018-02-28T13:00Z"
```

| Option | Description |
| ------ | ----------- |
| `-q`, `--query=VALUE` | The query to execute |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `--timeout=VALUE` | The query execution timeout in milliseconds |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `search`

Retrieve log events that match a given filter.

Example:

```
seqcli search -f "@Exception like '%TimeoutException%'" -c 30
```

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | A filter to apply to the search, for example `Host = 'xmpweb-01.example.com'` |
| `-c`, `--count=VALUE` | The maximum number of events to retrieve; the default is 1 |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `tail`

Stream log events matching a filter.

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | An optional server-side filter to apply to the stream, for example `@Level = 'Error'` |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `version`

Print the current executable version.
17 changes: 17 additions & 0 deletions appveyor.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
version: 0.1.{build}
skip_tags: true
image: Visual Studio 2017
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/seqcli-*.msi
- path: artifacts/seqcli-*.tar.gz
deploy:
- provider: GitHub
auth_token:
secure: Bo3ypKpKFxinjR9ShkNekNvkob2iklHJU+UlYyfHtcFFIAa58SV2TkEd0xWxz633
artifact: /seqcli-.*\.(msi|tar\.gz)/
tag: v$(appveyor_build_version)
on:
branch: master
Binary file addedasset/SeqCli-Icon-128px.ico
Binary file not shown.
Binary file addedasset/SeqCli-Icon-128px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions asset/SeqCli-Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedasset/SeqCli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Build.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
$ErrorActionPreference = 'Stop'

function Clean-Output
{
if(Test-Path ./artifacts) { rm ./artifacts -Force -Recurse }
}

function Restore-Packages
{
& dotnet restore
}

function Execute-Tests
{
& dotnet test ./test/SeqCli.Tests/SeqCli.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 3 }
}

function Create-ArtifactDir
{
mkdir ./artifacts
}

function Publish-Gzips($version)
{
$rids = @("linux-x64", "osx-x64")
foreach ($rid in $rids) {
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r $rid /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 4 }

# Make sure the archive contains a reasonable root filename
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/

& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

# Back to the original directory name
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/

& ./build/7-zip/7za.exe a -tgzip ./artifacts/seqcli-$version-$rid.tar.gz seqcli-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }

rm seqcli-$version-$rid.tar
}
}

function Publish-Msi($version)
{
& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r win-x64 /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 7 }

& msbuild ./setup/SeqCli.Setup/SeqCli.Setup.wixproj /t:Build /p:Configuration=Release /p:Platform=x64 /p:Version=$version /p:BuildProjectReferences=false
if($LASTEXITCODE -ne 0) { exit 8 }

mv ./setup/SeqCli.Setup/bin/Release/seqcli.msi ./artifacts/seqcli-$version.msi
}

Push-Location $PSScriptRoot

$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
Write-Output "Building version $version"

Clean-Output
Create-ArtifactDir
Restore-Packages
Publish-Msi($version)
Publish-Gzips($version)
Execute-Tests

Pop-Location
4 changes: 2 additions & 2 deletions LICENSE
Original file line numberDiff line numberDiff line change
Expand Up@@ -178,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
143 changes: 141 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,141 @@
# seqcli
Seq client command-line
# `seqcli` [![Build status](https://ci.appveyor.com/api/projects/status/sc3iacxwxqqfjgdh?svg=true)](https://ci.appveyor.com/project/datalust/seqcli) [![GitHub release](https://img.shields.io/github/release/datalust/seqcli.svg)](https://github.com/datalust/seqcli/releases)

The [Seq](https://getseq.net) client command-line app. Supports logging (`seqcli log`), searching (`search`), tailing (`tail`), querying (`query`) and [JSON log file](https://github.com/serilog/serilog-formatting-compact) ingestion (`ingest`).

![SeqCli Screenshot](https://raw.githubusercontent.com/datalust/seqcli/dev/asset/SeqCli.png)

## Getting started

Install or unzip the [release for your operating system](https://github.com/datalust/seqcli/releases).

To set a default server URL, run:

```
seqcli config -k connection.serverUrl -v https://your-seq-server
```

This will create `SeqConfig.json` in your home directory. A default API key can also be set by providing the `connection.apiKey` setting name.

## Commands

Usage:

```
seqcli <command> [<args>]
```

### `config`

View and set fields in the `SeqCli.json` file; run with no arguments to list all fields.

| Option | Description |
| ------ | ----------- |
| `-k`, `--key=VALUE` | The field, for example `connection.serverUrl` |
| `-v`, `--value=VALUE` | The field value; if not specified, the command will print the current value |
| `-c`, `--clear` | Clear the field |

### `help`

Show information about available commands.

| Option | Description |
| ------ | ----------- |
| `-m`, `--markdown` | Generate markdown for use in documentation |

### `ingest`

Send JSON log events from a file or `STDIN`.

Example:

```
seqcli ingest -i events.clef --filter="@Level <> 'Debug'" -p Environment=Test
```

| Option | Description |
| ------ | ----------- |
| `-i`, `--input=VALUE` | CLEF file to ingest; if not specified, `STDIN` will be used |
| `--invalid-data=VALUE` | Specify how invalid data is handled: fail (default) or ignore |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-f`, `--filter=VALUE` | Filter expression to select a subset of events |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `log`

Send a structured log event to the server.

Example:

```
seqcli log -m 'Hello, {Name}!' -p Name=World -p App=Test
```

| Option | Description |
| ------ | ----------- |
| `-m`, `--message=VALUE` | A message to associate with the event (the default is to send no message); https://messagetemplates.org syntax is supported |
| `-l`, `--level=VALUE` | The level or severity of the event (the default is `Information`) |
| `-t`, `--timestamp=VALUE` | The event timestamp as ISO-8601 (the current UTC timestamp will be used by default) |
| `-x`, `--exception=VALUE` | Additional exception or error information to send, if any |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `query`

Execute an SQL query and receive results in CSV format.

Example:

```
seqcli query -q "select count(*) from stream group by @Level" --start="2018-02-28T13:00Z"
```

| Option | Description |
| ------ | ----------- |
| `-q`, `--query=VALUE` | The query to execute |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `--timeout=VALUE` | The query execution timeout in milliseconds |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `search`

Retrieve log events that match a given filter.

Example:

```
seqcli search -f "@Exception like '%TimeoutException%'" -c 30
```

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | A filter to apply to the search, for example `Host = 'xmpweb-01.example.com'` |
| `-c`, `--count=VALUE` | The maximum number of events to retrieve; the default is 1 |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `tail`

Stream log events matching a filter.

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | An optional server-side filter to apply to the stream, for example `@Level = 'Error'` |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `version`

Print the current executable version.
17 changes: 17 additions & 0 deletions appveyor.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
version: 0.1.{build}
skip_tags: true
image: Visual Studio 2017
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/seqcli-*.msi
- path: artifacts/seqcli-*.tar.gz
deploy:
- provider: GitHub
auth_token:
secure: Bo3ypKpKFxinjR9ShkNekNvkob2iklHJU+UlYyfHtcFFIAa58SV2TkEd0xWxz633
artifact: /seqcli-.*\.(msi|tar\.gz)/
tag: v$(appveyor_build_version)
on:
branch: master
Binary file addedasset/SeqCli-Icon-128px.ico
Binary file not shown.
Binary file addedasset/SeqCli-Icon-128px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions asset/SeqCli-Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedasset/SeqCli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Build.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
$ErrorActionPreference = 'Stop'

function Clean-Output
{
if(Test-Path ./artifacts) { rm ./artifacts -Force -Recurse }
}

function Restore-Packages
{
& dotnet restore
}

function Execute-Tests
{
& dotnet test ./test/SeqCli.Tests/SeqCli.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 3 }
}

function Create-ArtifactDir
{
mkdir ./artifacts
}

function Publish-Gzips($version)
{
$rids = @("linux-x64", "osx-x64")
foreach ($rid in $rids) {
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r $rid /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 4 }

# Make sure the archive contains a reasonable root filename
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/

& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

# Back to the original directory name
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/

& ./build/7-zip/7za.exe a -tgzip ./artifacts/seqcli-$version-$rid.tar.gz seqcli-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }

rm seqcli-$version-$rid.tar
}
}

function Publish-Msi($version)
{
& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r win-x64 /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 7 }

& msbuild ./setup/SeqCli.Setup/SeqCli.Setup.wixproj /t:Build /p:Configuration=Release /p:Platform=x64 /p:Version=$version /p:BuildProjectReferences=false
if($LASTEXITCODE -ne 0) { exit 8 }

mv ./setup/SeqCli.Setup/bin/Release/seqcli.msi ./artifacts/seqcli-$version.msi
}

Push-Location $PSScriptRoot

$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
Write-Output "Building version $version"

Clean-Output
Create-ArtifactDir
Restore-Packages
Publish-Msi($version)
Publish-Gzips($version)
Execute-Tests

Pop-Location
4 changes: 2 additions & 2 deletions LICENSE
Original file line numberDiff line numberDiff line change
Expand Up@@ -178,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
143 changes: 141 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,141 @@
# seqcli
Seq client command-line
# `seqcli` [![Build status](https://ci.appveyor.com/api/projects/status/sc3iacxwxqqfjgdh?svg=true)](https://ci.appveyor.com/project/datalust/seqcli) [![GitHub release](https://img.shields.io/github/release/datalust/seqcli.svg)](https://github.com/datalust/seqcli/releases)

The [Seq](https://getseq.net) client command-line app. Supports logging (`seqcli log`), searching (`search`), tailing (`tail`), querying (`query`) and [JSON log file](https://github.com/serilog/serilog-formatting-compact) ingestion (`ingest`).

![SeqCli Screenshot](https://raw.githubusercontent.com/datalust/seqcli/dev/asset/SeqCli.png)

## Getting started

Install or unzip the [release for your operating system](https://github.com/datalust/seqcli/releases).

To set a default server URL, run:

```
seqcli config -k connection.serverUrl -v https://your-seq-server
```

This will create `SeqConfig.json` in your home directory. A default API key can also be set by providing the `connection.apiKey` setting name.

## Commands

Usage:

```
seqcli <command> [<args>]
```

### `config`

View and set fields in the `SeqCli.json` file; run with no arguments to list all fields.

| Option | Description |
| ------ | ----------- |
| `-k`, `--key=VALUE` | The field, for example `connection.serverUrl` |
| `-v`, `--value=VALUE` | The field value; if not specified, the command will print the current value |
| `-c`, `--clear` | Clear the field |

### `help`

Show information about available commands.

| Option | Description |
| ------ | ----------- |
| `-m`, `--markdown` | Generate markdown for use in documentation |

### `ingest`

Send JSON log events from a file or `STDIN`.

Example:

```
seqcli ingest -i events.clef --filter="@Level <> 'Debug'" -p Environment=Test
```

| Option | Description |
| ------ | ----------- |
| `-i`, `--input=VALUE` | CLEF file to ingest; if not specified, `STDIN` will be used |
| `--invalid-data=VALUE` | Specify how invalid data is handled: fail (default) or ignore |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-f`, `--filter=VALUE` | Filter expression to select a subset of events |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `log`

Send a structured log event to the server.

Example:

```
seqcli log -m 'Hello, {Name}!' -p Name=World -p App=Test
```

| Option | Description |
| ------ | ----------- |
| `-m`, `--message=VALUE` | A message to associate with the event (the default is to send no message); https://messagetemplates.org syntax is supported |
| `-l`, `--level=VALUE` | The level or severity of the event (the default is `Information`) |
| `-t`, `--timestamp=VALUE` | The event timestamp as ISO-8601 (the current UTC timestamp will be used by default) |
| `-x`, `--exception=VALUE` | Additional exception or error information to send, if any |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `query`

Execute an SQL query and receive results in CSV format.

Example:

```
seqcli query -q "select count(*) from stream group by @Level" --start="2018-02-28T13:00Z"
```

| Option | Description |
| ------ | ----------- |
| `-q`, `--query=VALUE` | The query to execute |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `--timeout=VALUE` | The query execution timeout in milliseconds |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `search`

Retrieve log events that match a given filter.

Example:

```
seqcli search -f "@Exception like '%TimeoutException%'" -c 30
```

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | A filter to apply to the search, for example `Host = 'xmpweb-01.example.com'` |
| `-c`, `--count=VALUE` | The maximum number of events to retrieve; the default is 1 |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `tail`

Stream log events matching a filter.

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | An optional server-side filter to apply to the stream, for example `@Level = 'Error'` |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `version`

Print the current executable version.
17 changes: 17 additions & 0 deletions appveyor.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
version: 0.1.{build}
skip_tags: true
image: Visual Studio 2017
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/seqcli-*.msi
- path: artifacts/seqcli-*.tar.gz
deploy:
- provider: GitHub
auth_token:
secure: Bo3ypKpKFxinjR9ShkNekNvkob2iklHJU+UlYyfHtcFFIAa58SV2TkEd0xWxz633
artifact: /seqcli-.*\.(msi|tar\.gz)/
tag: v$(appveyor_build_version)
on:
branch: master
Binary file addedasset/SeqCli-Icon-128px.ico
Binary file not shown.
Binary file addedasset/SeqCli-Icon-128px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions asset/SeqCli-Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedasset/SeqCli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Build.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
$ErrorActionPreference = 'Stop'

function Clean-Output
{
if(Test-Path ./artifacts) { rm ./artifacts -Force -Recurse }
}

function Restore-Packages
{
& dotnet restore
}

function Execute-Tests
{
& dotnet test ./test/SeqCli.Tests/SeqCli.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 3 }
}

function Create-ArtifactDir
{
mkdir ./artifacts
}

function Publish-Gzips($version)
{
$rids = @("linux-x64", "osx-x64")
foreach ($rid in $rids) {
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r $rid /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 4 }

# Make sure the archive contains a reasonable root filename
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/

& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

# Back to the original directory name
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/

& ./build/7-zip/7za.exe a -tgzip ./artifacts/seqcli-$version-$rid.tar.gz seqcli-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }

rm seqcli-$version-$rid.tar
}
}

function Publish-Msi($version)
{
& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r win-x64 /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 7 }

& msbuild ./setup/SeqCli.Setup/SeqCli.Setup.wixproj /t:Build /p:Configuration=Release /p:Platform=x64 /p:Version=$version /p:BuildProjectReferences=false
if($LASTEXITCODE -ne 0) { exit 8 }

mv ./setup/SeqCli.Setup/bin/Release/seqcli.msi ./artifacts/seqcli-$version.msi
}

Push-Location $PSScriptRoot

$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
Write-Output "Building version $version"

Clean-Output
Create-ArtifactDir
Restore-Packages
Publish-Msi($version)
Publish-Gzips($version)
Execute-Tests

Pop-Location
4 changes: 2 additions & 2 deletions LICENSE
Original file line numberDiff line numberDiff line change
Expand Up@@ -178,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
143 changes: 141 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,141 @@
# seqcli
Seq client command-line
# `seqcli` [![Build status](https://ci.appveyor.com/api/projects/status/sc3iacxwxqqfjgdh?svg=true)](https://ci.appveyor.com/project/datalust/seqcli) [![GitHub release](https://img.shields.io/github/release/datalust/seqcli.svg)](https://github.com/datalust/seqcli/releases)

The [Seq](https://getseq.net) client command-line app. Supports logging (`seqcli log`), searching (`search`), tailing (`tail`), querying (`query`) and [JSON log file](https://github.com/serilog/serilog-formatting-compact) ingestion (`ingest`).

![SeqCli Screenshot](https://raw.githubusercontent.com/datalust/seqcli/dev/asset/SeqCli.png)

## Getting started

Install or unzip the [release for your operating system](https://github.com/datalust/seqcli/releases).

To set a default server URL, run:

```
seqcli config -k connection.serverUrl -v https://your-seq-server
```

This will create `SeqConfig.json` in your home directory. A default API key can also be set by providing the `connection.apiKey` setting name.

## Commands

Usage:

```
seqcli <command> [<args>]
```

### `config`

View and set fields in the `SeqCli.json` file; run with no arguments to list all fields.

| Option | Description |
| ------ | ----------- |
| `-k`, `--key=VALUE` | The field, for example `connection.serverUrl` |
| `-v`, `--value=VALUE` | The field value; if not specified, the command will print the current value |
| `-c`, `--clear` | Clear the field |

### `help`

Show information about available commands.

| Option | Description |
| ------ | ----------- |
| `-m`, `--markdown` | Generate markdown for use in documentation |

### `ingest`

Send JSON log events from a file or `STDIN`.

Example:

```
seqcli ingest -i events.clef --filter="@Level <> 'Debug'" -p Environment=Test
```

| Option | Description |
| ------ | ----------- |
| `-i`, `--input=VALUE` | CLEF file to ingest; if not specified, `STDIN` will be used |
| `--invalid-data=VALUE` | Specify how invalid data is handled: fail (default) or ignore |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-f`, `--filter=VALUE` | Filter expression to select a subset of events |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `log`

Send a structured log event to the server.

Example:

```
seqcli log -m 'Hello, {Name}!' -p Name=World -p App=Test
```

| Option | Description |
| ------ | ----------- |
| `-m`, `--message=VALUE` | A message to associate with the event (the default is to send no message); https://messagetemplates.org syntax is supported |
| `-l`, `--level=VALUE` | The level or severity of the event (the default is `Information`) |
| `-t`, `--timestamp=VALUE` | The event timestamp as ISO-8601 (the current UTC timestamp will be used by default) |
| `-x`, `--exception=VALUE` | Additional exception or error information to send, if any |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `query`

Execute an SQL query and receive results in CSV format.

Example:

```
seqcli query -q "select count(*) from stream group by @Level" --start="2018-02-28T13:00Z"
```

| Option | Description |
| ------ | ----------- |
| `-q`, `--query=VALUE` | The query to execute |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `--timeout=VALUE` | The query execution timeout in milliseconds |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `search`

Retrieve log events that match a given filter.

Example:

```
seqcli search -f "@Exception like '%TimeoutException%'" -c 30
```

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | A filter to apply to the search, for example `Host = 'xmpweb-01.example.com'` |
| `-c`, `--count=VALUE` | The maximum number of events to retrieve; the default is 1 |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `tail`

Stream log events matching a filter.

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | An optional server-side filter to apply to the stream, for example `@Level = 'Error'` |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `version`

Print the current executable version.
17 changes: 17 additions & 0 deletions appveyor.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
version: 0.1.{build}
skip_tags: true
image: Visual Studio 2017
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/seqcli-*.msi
- path: artifacts/seqcli-*.tar.gz
deploy:
- provider: GitHub
auth_token:
secure: Bo3ypKpKFxinjR9ShkNekNvkob2iklHJU+UlYyfHtcFFIAa58SV2TkEd0xWxz633
artifact: /seqcli-.*\.(msi|tar\.gz)/
tag: v$(appveyor_build_version)
on:
branch: master
Binary file addedasset/SeqCli-Icon-128px.ico
Binary file not shown.
Binary file addedasset/SeqCli-Icon-128px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions asset/SeqCli-Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedasset/SeqCli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Build.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
$ErrorActionPreference = 'Stop'

function Clean-Output
{
if(Test-Path ./artifacts) { rm ./artifacts -Force -Recurse }
}

function Restore-Packages
{
& dotnet restore
}

function Execute-Tests
{
& dotnet test ./test/SeqCli.Tests/SeqCli.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 3 }
}

function Create-ArtifactDir
{
mkdir ./artifacts
}

function Publish-Gzips($version)
{
$rids = @("linux-x64", "osx-x64")
foreach ($rid in $rids) {
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r $rid /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 4 }

# Make sure the archive contains a reasonable root filename
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/

& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

# Back to the original directory name
mv ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/netcoreapp2.0/$rid/publish/

& ./build/7-zip/7za.exe a -tgzip ./artifacts/seqcli-$version-$rid.tar.gz seqcli-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }

rm seqcli-$version-$rid.tar
}
}

function Publish-Msi($version)
{
& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f netcoreapp2.0 -r win-x64 /p:VersionPrefix=$version /p:ShowLinkerSizeComparison=true
if($LASTEXITCODE -ne 0) { exit 7 }

& msbuild ./setup/SeqCli.Setup/SeqCli.Setup.wixproj /t:Build /p:Configuration=Release /p:Platform=x64 /p:Version=$version /p:BuildProjectReferences=false
if($LASTEXITCODE -ne 0) { exit 8 }

mv ./setup/SeqCli.Setup/bin/Release/seqcli.msi ./artifacts/seqcli-$version.msi
}

Push-Location $PSScriptRoot

$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
Write-Output "Building version $version"

Clean-Output
Create-ArtifactDir
Restore-Packages
Publish-Msi($version)
Publish-Gzips($version)
Execute-Tests

Pop-Location
4 changes: 2 additions & 2 deletions LICENSE
Original file line numberDiff line numberDiff line change
Expand Up@@ -178,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
143 changes: 141 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,141 @@
# seqcli
Seq client command-line
# `seqcli` [![Build status](https://ci.appveyor.com/api/projects/status/sc3iacxwxqqfjgdh?svg=true)](https://ci.appveyor.com/project/datalust/seqcli) [![GitHub release](https://img.shields.io/github/release/datalust/seqcli.svg)](https://github.com/datalust/seqcli/releases)

The [Seq](https://getseq.net) client command-line app. Supports logging (`seqcli log`), searching (`search`), tailing (`tail`), querying (`query`) and [JSON log file](https://github.com/serilog/serilog-formatting-compact) ingestion (`ingest`).

![SeqCli Screenshot](https://raw.githubusercontent.com/datalust/seqcli/dev/asset/SeqCli.png)

## Getting started

Install or unzip the [release for your operating system](https://github.com/datalust/seqcli/releases).

To set a default server URL, run:

```
seqcli config -k connection.serverUrl -v https://your-seq-server
```

This will create `SeqConfig.json` in your home directory. A default API key can also be set by providing the `connection.apiKey` setting name.

## Commands

Usage:

```
seqcli <command> [<args>]
```

### `config`

View and set fields in the `SeqCli.json` file; run with no arguments to list all fields.

| Option | Description |
| ------ | ----------- |
| `-k`, `--key=VALUE` | The field, for example `connection.serverUrl` |
| `-v`, `--value=VALUE` | The field value; if not specified, the command will print the current value |
| `-c`, `--clear` | Clear the field |

### `help`

Show information about available commands.

| Option | Description |
| ------ | ----------- |
| `-m`, `--markdown` | Generate markdown for use in documentation |

### `ingest`

Send JSON log events from a file or `STDIN`.

Example:

```
seqcli ingest -i events.clef --filter="@Level <> 'Debug'" -p Environment=Test
```

| Option | Description |
| ------ | ----------- |
| `-i`, `--input=VALUE` | CLEF file to ingest; if not specified, `STDIN` will be used |
| `--invalid-data=VALUE` | Specify how invalid data is handled: fail (default) or ignore |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-f`, `--filter=VALUE` | Filter expression to select a subset of events |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `log`

Send a structured log event to the server.

Example:

```
seqcli log -m 'Hello, {Name}!' -p Name=World -p App=Test
```

| Option | Description |
| ------ | ----------- |
| `-m`, `--message=VALUE` | A message to associate with the event (the default is to send no message); https://messagetemplates.org syntax is supported |
| `-l`, `--level=VALUE` | The level or severity of the event (the default is `Information`) |
| `-t`, `--timestamp=VALUE` | The event timestamp as ISO-8601 (the current UTC timestamp will be used by default) |
| `-x`, `--exception=VALUE` | Additional exception or error information to send, if any |
| `-p`, `--property=VALUE1=VALUE2` | Specify event properties, e.g. `-p Customer=C123 -p Environment=Production` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `query`

Execute an SQL query and receive results in CSV format.

Example:

```
seqcli query -q "select count(*) from stream group by @Level" --start="2018-02-28T13:00Z"
```

| Option | Description |
| ------ | ----------- |
| `-q`, `--query=VALUE` | The query to execute |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `--timeout=VALUE` | The query execution timeout in milliseconds |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `search`

Retrieve log events that match a given filter.

Example:

```
seqcli search -f "@Exception like '%TimeoutException%'" -c 30
```

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | A filter to apply to the search, for example `Host = 'xmpweb-01.example.com'` |
| `-c`, `--count=VALUE` | The maximum number of events to retrieve; the default is 1 |
| `--start=VALUE` | ISO 8601 date/time to query from |
| `--end=VALUE` | Date/time to query to |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `tail`

Stream log events matching a filter.

| Option | Description |
| ------ | ----------- |
| `-f`, `--filter=VALUE` | An optional server-side filter to apply to the stream, for example `@Level = 'Error'` |
| `--json` | Print events in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `--signal=VALUE` | A signal expression or list of intersected signal ids to apply, for example `signal-1,signal-2` |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default `config.apiKey` value will be used |

### `version`

Print the current executable version.
17 changes: 17 additions & 0 deletions appveyor.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
version: 0.1.{build}
skip_tags: true
image: Visual Studio 2017
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/seqcli-*.msi
- path: artifacts/seqcli-*.tar.gz
deploy:
- provider: GitHub
auth_token:
secure: Bo3ypKpKFxinjR9ShkNekNvkob2iklHJU+UlYyfHtcFFIAa58SV2TkEd0xWxz633
artifact: /seqcli-.*\.(msi|tar\.gz)/
tag: v$(appveyor_build_version)
on:
branch: master
Binary file addedasset/SeqCli-Icon-128px.ico
Binary file not shown.
Binary file addedasset/SeqCli-Icon-128px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions asset/SeqCli-Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedasset/SeqCli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading