GithubHelp home page GithubHelp logo

datalust / seq-app-httprequest Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 3.0 298 KB

Send events and notifications to an HTTP/REST/Webhook endpoint.

License: Apache License 2.0

PowerShell 9.96% C# 90.04%

seq-app-httprequest's People

Contributors

liammclennan avatar nblumhardt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

seq-app-httprequest's Issues

Unable to extract properties from source event

I seem to be unable to extract custom properties from the underlying event that caused the alert when using this app, yet I feel like I've followed the documents to a tee.

I want to extract the Application and MachineName from this simple event

Event

image

App Instance

image

Alert Definition

image

Yet I can't receive any of my custom properties

{
  "Message": "Alert condition triggered by admin/Healthcheck",
  "MessageTemplate": "Alert condition triggered by {NamespacedAlertTitle}",
  "Dictionary": {
    "@seqid": "event-50fa9bbbc4a408d90000000000000000",
    "NamespacedAlertTitle": "admin/Healthcheck",
    "Alert": {
      "Id": "alert-40",
      "Title": "Healthcheck",
      "Url": "http://localhost:80/#/alerts/alert-40",
      "OwnerUsername": "admin",
      "SignalExpressionDescription": null,
      "Query": "select count(*) as count from stream where functionName = 'Health' and status = 'Succeeded' group by time(1m) having count > 0 limit 100",
      "HavingClause": "count > 0",
      "TimeGrouping": "1 minute"
    },
    "Source": {
      "RangeStart": "2021-12-21T17:05:36.1917627Z",
      "RangeEnd": "2021-12-21T17:06:36.1917627Z",
      "ResultsUrl": "http://localhost:80/#/events?q=select%20count%28%2A%29%20as%20count%20from%20stream%20where%20functionName%20%3D%20%27Health%27%20and%20status%20%3D%20%27Succeeded%27%20group%20by%20time%281m%29%20having%20count%20%3E%200%20limit%20100&from=2021-12-21T17:05:36.1917627Z&to=2021-12-21T17:06:36.1917627Z",
      "Results": [
        [
          "time",
          "count"
        ],
        [
          "2021-12-21T17:05:36.1917627Z",
          4
        ]
      ],
      "ContributingEvents": [
        [
          "@Id",
          "(Column 2)",
          "@Message"
        ],
        [
          "event-2913c038c4a408d99cc2060000000000",
          "2021-12-21T17:05:59.2476728Z",
          "Executed 'Health' (Succeeded, Id=b026d54f-1bf8-40b1-bfd5-deb376336c6e, Duration=1ms)"
        ]
      ]
    },
    "SuppressedUntil": "2021-12-21T17:08:06.1917627Z",
    "Failures": null,
    "@i": "a1e77001"
  }
}

Is this something I've done wrong?

Zoom webhooks: " Outbound HTTP request failed with status code BadRequest"

I've installed the following app: HTTP 1.0.0-dev-00016 by Datalust...

Added an instance (_REMOVED_PART indicates part of the secret has been removed for posting here):

{
  "Url": "https://inbots.zoom.us/incoming/hook/XIuu0_REMOVED_PART",
  "Method": "POST",
  "Body": "",
  "BodyIsTemplate": "False",
  "MediaType": "application/json",
  "AuthenticationHeader": "",
  "OtherHeaders": "Authorization: dZH7ayu8_REMOVED_PART",
  "ExtendedErrorDiagnostics": "False"
}

The error I get is:

{"@t":"2022-11-15T00:45:22.6578637Z","@mt":"Outbound HTTP request failed with status code {StatusCode}","@m":"Outbound HTTP request failed with status code BadRequest","@i":"93101f49","@l":"Error","StatusCode":"BadRequest","AppId":"hostedapp-69","AppInstanceId":"appinstance-71"}

I've also tried this, but got the same error:

...
  "Body": "test",
  "BodyIsTemplate": "true",
...

I've proven the webhook works by run this locally:

curl 'https://inbots.zoom.us/incoming/hook/XIuu04_REMOVED_PART' -X POST -H 'Authorization: dZH7ayu_REMOVED_PART' -d 'Hello World!'

image

Trouble with substitutions inside templated JSON

Should we be able to substitute inside a JSON template using expressions / directives?

e.g.

{ { 'rawTime': @t, 'formattedTime': 'The time is {@t:HH:mm:ss}' } }

outputs

{ "rawTime": "2022-01-05T16:29:09.7599190+00:00", "formattedTime": "The time is {@t:HH:mm:ss}" }

I can't seem to find any relevant documentation as to how I might "escape" out of the JSON to indicate a substitution is required when trying to perform interpolation

Authentication failing with Twilio

Outbound HTTP request failed with status code Unauthorized

tried using : in Authentication Header
tried also using base64 encoded version of : in Authentication Header

same response

What am I missing?

Requires mediaType althouth it's said to be optional

System.ArgumentException: The value cannot be null or empty. (Parameter 'mediaType')
   at System.Net.Http.Headers.MediaTypeHeaderValue.CheckMediaTypeFormat(String mediaType, String parameterName)
   at System.Net.Http.StringContent..ctor(String content, Encoding encoding, String mediaType)
   at Seq.App.HttpRequest.HttpRequestMessageFactory.FromEvent(LogEvent evt) in C:\projects\seq-app-httprequest\src\Seq.App.HttpRequest\HttpRequestMessageFactory.cs:line 57
   at Seq.App.HttpRequest.HttpApp.OnAsync(Event`1 evt) in C:\projects\seq-app-httprequest\src\Seq.App.HttpRequest\HttpApp.cs:line 84
   at SeqCli.Apps.Hosting.AppContainer.SendTypedEventAsync(String clef) in C:\projects\seqcli\src\SeqCli\Apps\Hosting\AppContainer.cs:line 121

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.