diff --git a/src/Seq.App.Slack/Messages/AlertV2MessageBuilder.cs b/src/Seq.App.Slack/Messages/AlertV2MessageBuilder.cs index b00c4f6..cf84079 100644 --- a/src/Seq.App.Slack/Messages/AlertV2MessageBuilder.cs +++ b/src/Seq.App.Slack/Messages/AlertV2MessageBuilder.cs @@ -125,16 +125,23 @@ ce is IEnumerable contributingEvents && var text = new StringBuilder(); foreach (var contributing in contributingEvents.Skip(1).Cast>()) { - var columns = contributing.Cast().ToArray(); + var columns = contributing.ToArray(); + + const int contributingEventsIdIndex = 0, + contributingEventsTimestampIndex = 1, + contributingEventsMessageIndex = 2; // Timestamp as ISO-8601 string - text.Append(SlackSyntax.Code(columns[1])); + text.Append(SlackSyntax.Code(columns[contributingEventsTimestampIndex] as string ?? "")); text.Append(' '); // Message, linking to event - text.Append(SlackSyntax.Hyperlink(EventFormatting.LinkToId(_host, columns[0]), - SlackSyntax.Escape(columns[2]))); + text.Append(SlackSyntax.Hyperlink(EventFormatting.LinkToId(_host, columns[contributingEventsIdIndex] as string ?? ""), + SlackSyntax.Escape(columns[contributingEventsMessageIndex] as string ?? ""))); text.Append('\n'); + + // Group key values currently ignored, they're included in Results. Some additional formatting + // work would be needed if we were to add them here. } var events = new SlackMessageAttachment(color, text.ToString(), "Contributing Events"); diff --git a/src/Seq.App.Slack/Seq.App.Slack.csproj b/src/Seq.App.Slack/Seq.App.Slack.csproj index 66cc8e1..985ab68 100644 --- a/src/Seq.App.Slack/Seq.App.Slack.csproj +++ b/src/Seq.App.Slack/Seq.App.Slack.csproj @@ -2,7 +2,7 @@ net8.0 - 2.0.0 + 2.0.1 An app for Seq that forwards events and notifications to Slack. bytenik, Datalust, and Contributors seq-app