Skip to content

Commit

Permalink
Merge pull request #178 from datalust/dev
Browse files Browse the repository at this point in the history
2021.1 Maintenance Release
  • Loading branch information
nblumhardt authored Mar 9, 2021
2 parents 6369757 + 6865c36 commit c5be42e
Show file tree
Hide file tree
Showing 109 changed files with 3,970 additions and 102 deletions.
6 changes: 3 additions & 3 deletions Build.Docker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ $tag = "datalust/seqcli-ci:$version"

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

cd ./test/SeqCli.EndToEnd/
docker pull datalust/seq:latest
& dotnet run -- --docker-server
& dotnet run -f $framework -- --docker-server
if ($LASTEXITCODE -ne 0) { exit 1 }
cd ../..
}

function Build-DockerImage
{
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f $framework -r $rid /p:VersionPrefix=$version /p:SeqCliRid=$rid /p:ShowLinkerSizeComparison=true
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f $framework -r $rid /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 2 }

& docker build -f dockerfiles/seqcli/Dockerfile -t $tag .
Expand Down
18 changes: 12 additions & 6 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$ErrorActionPreference = 'Stop'

$framework = 'net5.0'
$windowsTfmSuffix = '-windows'

function Clean-Output
{
Expand All @@ -27,21 +28,26 @@ function Publish-Archives($version)
{
$rids = @("linux-x64", "linux-musl-x64", "osx-x64", "win-x64")
foreach ($rid in $rids) {
& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f $framework -r $rid /p:VersionPrefix=$version /p:SeqCliRid=$rid
$tfm = $framework
if ($rid -eq "win-x64") {
$tfm = "$tfm$windowsTfmSuffix"
}

& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f $tfm -r $rid /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 4 }

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

if ($rid.StartsWith("win-")) {
& ./build/7-zip/7za.exe a -tzip ./artifacts/seqcli-$version-$rid.zip ./src/SeqCli/bin/Release/$framework/$rid/seqcli-$version-$rid/
& ./build/7-zip/7za.exe a -tzip ./artifacts/seqcli-$version-$rid.zip ./src/SeqCli/bin/Release/$tfm/$rid/seqcli-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }
} else {
& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/$framework/$rid/seqcli-$version-$rid/
& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/$tfm/$rid/seqcli-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

# Back to the original directory name
mv ./src/SeqCli/bin/Release/$framework/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/$framework/$rid/publish/
mv ./src/SeqCli/bin/Release/$tfm/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/$tfm/$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 }
Expand All @@ -53,7 +59,7 @@ function Publish-Archives($version)

function Publish-DotNetTool($version)
{
dotnet pack ./src/SeqCli/SeqCli.csproj -c Release --output ./artifacts /p:VersionPrefix=$version
dotnet pack ./src/SeqCli/SeqCli.csproj -c Release --output ./artifacts /p:VersionPrefix=$version
}

Push-Location $PSScriptRoot
Expand Down
105 changes: 98 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `seqcli` [![Build status](https://ci.appveyor.com/api/projects/status/sc3iacxwxqqfjgdh/branch/dev?svg=true)](https://ci.appveyor.com/project/datalust/seqcli/branch/dev) [![GitHub release](https://img.shields.io/github/release/datalust/seqcli.svg)](https://github.com/datalust/seqcli/releases)

The [Seq](https://datalust.co/seq) client command-line app. Supports logging (`seqcli log`), searching (`search`), tailing (`tail`), querying (`query`) and [JSON or plain-text log file](https://github.com/serilog/serilog-formatting-compact) ingestion (`ingest`).
The [Seq](https://datalust.co/seq) client command-line app. Supports logging (`seqcli log`), searching (`search`), tailing (`tail`), querying (`query`) and [JSON or plain-text log file](https://github.com/serilog/serilog-formatting-compact) ingestion (`ingest`), and [much more](https://github.com/datalust/seqcli#commands).

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

Expand Down Expand Up @@ -42,7 +42,9 @@ Available commands:
- [`apikey create`](#apikey-create) — Create an API key for ingestion.
- [`apikey list`](#apikey-list) — List available API keys.
- [`apikey remove`](#apikey-remove) — Remove an API key from the server.
- [`app-run`](#app-run) — Host a .NET `[SeqApp]` plug-in.
- `app`
- [`app define`](#app-define) — Generate an app definition for a .NET `[SeqApp]` plug-in.
- [`app run`](#app-run) — Host a .NET `[SeqApp]` plug-in.
- [`config`](#config) — View and set fields in the `SeqCli.json` file; run with no arguments to list all fields.
- `dashboard`
- [`dashboard list`](#dashboard-list) — List dashboards.
Expand All @@ -69,6 +71,10 @@ Available commands:
- [`user list`](#user-list) — List users.
- [`user remove`](#user-remove) — Remove a user from the server.
- [`version`](#version) — Print the current executable version.
- `workspace`
- [`workspace create`](#workspace-create) — Create a workspace.
- [`workspace list`](#workspace-list) — List available workspaces.
- [`workspace remove`](#workspace-remove) — Remove a workspace from the server.

### `apikey remove`

Expand Down Expand Up @@ -145,10 +151,30 @@ seqcli tail --json | seqcli app run -d "./bin/Debug/netstandard2.2" -p ToAddress
| Option | Description |
| ------ | ----------- |
| `-d`, `--directory=VALUE` | The directory containing .NET Standard assemblies; defaults to the current directory |
| `-t`, `--type=VALUE` | The [SeqApp] plug-in type name; defaults to scanning assemblies for a single type marked with this attribute |
| `--type=VALUE` | The [SeqApp] plug-in type name; defaults to scanning assemblies for a single type marked with this attribute |
| `-p`, `--property=NAME=VALUE` | Specify name/value settings for the app, e.g. `-p [email protected] -p Subject="Alert!"` |
| `-s`, `--server=VALUE` | The URL of the Seq server, used only for app configuration (no connection is made to the server); by default the `connection.serverUrl` value will be used |
| `--storage=VALUE` | A directory in which app-specific data can be stored; defaults to the current directory |
| `-s`, `--server=VALUE` | The URL of the Seq server, used only for app configuration (no connection is made to the server); by default the `connection.serverUrl` value will be used |
| `--server-instance=VALUE` | The instance name of the Seq server, used only for app configuration; defaults to no instance name |
| `-t`, `--title=VALUE` | The app instance title, used only for app configuration; defaults to a placeholder title. |
| `--id=VALUE` | The app instance id, used only for app configuration; defaults to a placeholder id. |
| `--read-env` | Read app configuration and settings from environment variables, as specified in https://docs.datalust.co/docs/seq-apps-in-other-languages; ignores all options except --directory and --type |

### `app define`

Generate an app definition for a .NET `[SeqApp]` plug-in.

Example:

```
seqcli app define -d "./bin/Debug/netstandard2.2"
```

| Option | Description |
| ------ | ----------- |
| `-d`, `--directory=VALUE` | The directory containing .NET Standard assemblies; defaults to the current directory |
| `--type=VALUE` | The [SeqApp] plug-in type name; defaults to scanning assemblies for a single type marked with this attribute |
| `--indented` | Format the definition over multiple lines with indentation |

### `config`

Expand Down Expand Up @@ -179,7 +205,7 @@ seqcli dashboard render -i dashboard-159 -c 'Response Time (ms)' --last 7d --by
| `--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 |
| `--timeout=VALUE` | The execution timeout in milliseconds |
| `--json` | Print output in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` config value will be used |
Expand Down Expand Up @@ -360,7 +386,7 @@ seqcli query -q "select count(*) from stream group by @Level" --start="2018-02-2
| `--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 |
| `--timeout=VALUE` | The execution timeout in milliseconds |
| `--json` | Print output in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` config value will be used |
Expand Down Expand Up @@ -442,12 +468,12 @@ seqcli signal import -i ./Exceptions.json

| Option | Description |
| ------ | ----------- |
| `--merge` | Update signals that have ids matching those in the imported data; the default is to always create new signals |
| `-i`, `--input=VALUE` | File to import; if not specified, `STDIN` will be used |
| `-o`, `--owner=VALUE` | The id of the user to import signals for; by default, shared signals are importd |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` config value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default the `connection.apiKey` config value will be used |
| `--profile=VALUE` | A connection profile to use; by default the `connection.serverUrl` and `connection.apiKey` config values will be used |
| `--merge` | Update signals that have ids matching those in the imported data; the default is to always create new signals |

### `signal create`

Expand Down Expand Up @@ -554,6 +580,70 @@ seqcli user create -n alice -d 'Alice Example' -r 'User (read/write)' --password

Print the current executable version.

### `workspace remove`

Remove a workspace from the server.

Example:

```
seqcli workspace remove -t 'My Workspace'
```

| Option | Description |
| ------ | ----------- |
| `-t`, `--title=VALUE` | The title of the workspace(s) to remove |
| `-i`, `--id=VALUE` | The id of a single workspace to remove |
| `-o`, `--owner=VALUE` | The id of the user to remove workspaces for; by default, shared workspaces are removd |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` config value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default the `connection.apiKey` config value will be used |
| `--profile=VALUE` | A connection profile to use; by default the `connection.serverUrl` and `connection.apiKey` config values will be used |

### `workspace list`

List available workspaces.

Example:

```
seqcli workspace list
```

| Option | Description |
| ------ | ----------- |
| `-t`, `--title=VALUE` | The title of the workspace(s) to list |
| `-i`, `--id=VALUE` | The id of a single workspace to list |
| `-o`, `--owner=VALUE` | The id of the user to list workspaces for; by default, shared workspaces are listd |
| `--json` | Print output in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` config value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default the `connection.apiKey` config value will be used |
| `--profile=VALUE` | A connection profile to use; by default the `connection.serverUrl` and `connection.apiKey` config values will be used |

### `workspace create`

Create a workspace.

Example:

```
seqcli workspace create -t 'My Workspace'
```

| Option | Description |
| ------ | ----------- |
| `-t`, `--title=VALUE` | A title for the workspace |
| `--description=VALUE` | A description for the workspace |
| `--dashboard=VALUE` | The id of a dashboard to include in the workspace |
| `--query=VALUE` | The id of a saved query to include in the workspace |
| `--signal=VALUE` | The id of a signal to include in the workspace |
| `--protected` | Specify that the workspace is editable only by administrators |
| `-s`, `--server=VALUE` | The URL of the Seq server; by default the `connection.serverUrl` config value will be used |
| `-a`, `--apikey=VALUE` | The API key to use when connecting to the server; by default the `connection.apiKey` config value will be used |
| `--profile=VALUE` | A connection profile to use; by default the `connection.serverUrl` and `connection.apiKey` config values will be used |
| `--json` | Print output in newline-delimited JSON (the default is plain text) |
| `--no-color` | Don't colorize text output |

## Extraction patterns

The `seqcli ingest` command can be used for parsing plain text logs into structured log events.
Expand Down Expand Up @@ -629,6 +719,7 @@ There are three kinds of matchers:
| `timestamp` | A datetime in any recognized format | |
| `token` | Any sequence of non-whitespace characters | `1+x$3` |
| `trailingident` | Multiline content with indented trailing lines | |
| `unixdt` | A datetime in Unix time format supporting seconds (10-digit) or milliseconds (12-digit) | `1608694199.999` |
| `w3cdt` | A W3C log format date/time pair | `2019-04-02 05:18:01` |

### Processing
Expand Down
20 changes: 0 additions & 20 deletions SeqCli.Runtime.targets

This file was deleted.

8 changes: 7 additions & 1 deletion seqcli.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sln", "sln", "{2EA56595-519
global.json = global.json
LICENSE = LICENSE
README.md = README.md
SeqCli.Runtime.targets = SeqCli.Runtime.targets
setup.sh = setup.sh
Build.Docker.ps1 = Build.Docker.ps1
docker-publish.ps1 = docker-publish.ps1
Expand Down Expand Up @@ -44,6 +43,8 @@ ProjectSection(SolutionItems) = preProject
dockerfiles\seqcli\run.sh = dockerfiles\seqcli\run.sh
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Roastery", "src\Roastery\Roastery.csproj", "{D2CB1112-7CD3-4A1B-A114-25130C96295E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -62,6 +63,10 @@ Global
{B86DEF3C-C461-4126-AD49-986EBB19B487}.Debug|x64.Build.0 = Debug|x64
{B86DEF3C-C461-4126-AD49-986EBB19B487}.Release|x64.ActiveCfg = Release|x64
{B86DEF3C-C461-4126-AD49-986EBB19B487}.Release|x64.Build.0 = Release|x64
{D2CB1112-7CD3-4A1B-A114-25130C96295E}.Debug|x64.ActiveCfg = Debug|Any CPU
{D2CB1112-7CD3-4A1B-A114-25130C96295E}.Debug|x64.Build.0 = Debug|Any CPU
{D2CB1112-7CD3-4A1B-A114-25130C96295E}.Release|x64.ActiveCfg = Release|Any CPU
{D2CB1112-7CD3-4A1B-A114-25130C96295E}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -71,6 +76,7 @@ Global
{DBC69360-519B-4A9B-829B-2AE1B5412521} = {3587B633-0C03-4235-8903-6226900328F1}
{B86DEF3C-C461-4126-AD49-986EBB19B487} = {3587B633-0C03-4235-8903-6226900328F1}
{7F7CAC3A-1046-4D2B-BF9F-F14525918295} = {0779824B-502D-450B-BB43-036949C911C4}
{D2CB1112-7CD3-4A1B-A114-25130C96295E} = {FC0A256C-CC1F-4ECE-AF09-707248D10DC1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6D299713-28D4-4078-9DA7-9033679CD200}
Expand Down
5 changes: 5 additions & 0 deletions seqcli.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=apikey/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=appinstance/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=appinstances/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BASEURI/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Camelize/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=cmds/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=command_0027s/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Datalust/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=delim/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Enricher/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=enrichers/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=formattable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gravatar/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=hackily/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mdash/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=retentionpolicies/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=roastery/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=seqcli/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Serilog/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=serilogdt/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sqlqueries/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=STDIN/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=STORAGEPATH/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=subcommand/@EntryIndexedValue">True</s:Boolean>
Expand Down
Loading

0 comments on commit c5be42e

Please sign in to comment.