Reporting all the things
Seq Reporter is the command-line client that can be used to schedule reporting from your Seq structured logs. It drives a number of daily and monthly reports for us and overall, it works well. We just set our query config and time range, schedule it, and away it goes with no fuss!
With the creation of Lurgle.Dates, I included the Seq Reporter date expression logic in this new common date library, so it made it inevitable that I'd update Seq Reporter to use the common library ... but I looked at what else would be useful for us.
A number of our reports are bound for Jira, as part of scheduled monthly SLA reporting. We were emailing them to a Jira mailbox, which would then pick it up and turn it into a ticket. The obvious opportunity here is to instead create the ticket directly from Seq Reporter.
It helped to be using Lurgle.Dates, because we could also leverage the Jira date token logic that I'd merged into this library. I did add an additional method to Lurgle.Dates that allows conversion of these tokens to a DateTime for the purpose of configuring the optional Due Date field in Jira, so Lurgle.Dates v1.0.7 is now out!
With v1.0.3, you'll see that the Test.config file now contains additional config items:
<add key="ValidateTls" value="false" />
<!-- Email, Jira, EmailAndJira -->
<add key="ReportDestination" value="Jira" />
<!-- Mandatory Jira attributes-->
<add key="JiraUrl" value="https://jira.domain.com" />
<add key="JiraUsername" value="Bob" />
<add key="JiraPassword" value="Builder" />
<add key="JiraProject" value="TEST" />
<add key="JiraIssueType" value="Task" />
<add key="JiraPriority" value="Medium" />
<!-- Optional attributes -->
<add key="JiraAssignee" value="BBuilder" />
<add key="JiraLabels" value="Test,Labels" />
<add key="JiraInitialEstimate" value="1d" />
<add key="JiraRemainingEstimate" value="1d" />
<add key="JiraDueDate" value="7d" />
This is a new config attribute which defaults to true. In v1.0.2, Seq Reporter was always disabling TLS validation because it helped with test scenarios. I've turned that into a configuration because it's generally best practice to validate TLS connections.
If set to false, all TLS validation will be disabled. If set to true - the default - Seq Reporter will validate TLS connections using the standard .NET TLS validation rules.
There are 6 mandatory and 5 optional Jira configs.
|JiraUrl||The URL of your Jira instance with http:// or https:// prefix. Only the FQDN (eg. https://jira.domain.com) is needed.||Yes|
|JiraUsername||A username with permission to logon to Jira and create issues via the REST API.||Yes|
|JiraPassword||Password for the Jira user||Yes|
|JiraProject||The project key to create an issue under||Yes|
|JiraIssueType||Type of issue to create, eg. Task, Service Request, Incident||Yes|
|JiraPriority||Priority of issue, eg. Highest, High, Medium, Low||Yes|
|JiraAssignee||A valid Jira username to assign the ticket to||No|
|JiraLabels||A comma-delimited list of labels to apply to the ticket. Don't put spaces in labels.||No|
|JiraInitialEstimate||The Original Time Estimate field for the Jira issue. If not supported by the project, ticket may fail.||No|
|JiraRemainingEstimate||Remaining Time Estimate field for the Jira issue. If configured, JiraInitialTimeEstimate is also required, or time tracking fields won't be added.||No|
|JiraDueDate||Due Date expressed as a Jira date expression (eg. 7d)||No|
If configured correctly, issues will automatically be created with the report attached!
The Templates folder includes an alertJiraTemplate.txt file. This has a Handlebars template that will be used for creating the issue, which allows customisation of the ticket's description.
The Jira issue logic uses the same proxy settings as Seq - so if you disable proxy for Seq, it will be disabled for Jira as well.
Update to QueryTimeout
The QueryTimeout config setting had an error which meant that it wasn't used. I've fixed that, and also ensured that both the Seq query and the underlying HttpClient are set to the QueryTimeout. That should address queries failing before it's expected.
Get Seq Reporter!
As always, you can download the latest version via the below fancy links. I may yet update Seq.Client.Reporter to include delivering reports via SFTP, but I'm happy with this new enhancement!