serilog-contrib / serilog-sinks-splunk

A Serilog sink that writes to Splunk
https://splunk.com
Apache License 2.0
46 stars 47 forks source link

Allow for providing splunkHost as-is? #205

Closed VictorioBerra closed 2 months ago

VictorioBerra commented 4 months ago

My config today is:

    "WriteTo": [
      {
        "Name": "EventCollector",
        "Args": {
          "splunkHost": "https://splunk.example.com/services/collector",
          "eventCollectorToken": "111-222-333"
        }
      }
    ],

splunkHost has the path, and is in our KeyVaults.

I noticed this changed with 4.0.0.

Is there a way to avoid changing splunkHost? For example, the fix I want to avoid:

    "WriteTo": [
      {
        "Name": "EventCollector",
        "Args": {
          "splunkHost": "https://splunk.example.com",
          "uriPath": "/services/collector",
          "eventCollectorToken": "111-222-333"
        }
      }
    ],
EEParker commented 4 months ago

Good idea. The splunkHost argument could probably be parsed and split to uriPath if it contains the subpaths.

EEParker commented 3 months ago

@VictorioBerra I just pushed a bugfix branch for this, I believe this was unintended operation. If you can test out the patch, I will roll that in with this 5.0 release that also updates Serilog to 4.0

https://www.nuget.org/packages/Serilog.Sinks.Splunk/5.0.0-dev-00073

VictorioBerra commented 3 months ago

I will get this tested shortly

EEParker commented 3 months ago

Did you get a chance to test this? @VictorioBerra

VictorioBerra commented 3 months ago

Did you get a chance to test this? @VictorioBerra

Yes I did, it worked great thank you! I replied a while ago here: https://github.com/serilog-contrib/serilog-sinks-splunk/pull/211#issuecomment-2155555739

I should have replied to the issue here though, sorry about that.