Skip to content

Commit cdf7167

Browse files
authored
Fix for #205 allow collector path in host url (#211)
* Fix for #205 allow collector path in host url * Remove redundant check
1 parent d3c81a5 commit cdf7167

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Serilog.Sinks.Splunk/ConfigurationDefaults.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ internal static class ConfigurationDefaults
1414
/// https://docs.splunk.com/Documentation/Splunk/9.1.0/Data/UsetheHTTPEventCollector#Send_data_to_HTTP_Event_Collector_on_Splunk_Enterprise
1515
/// </remarks>
1616
internal const string DefaultEventCollectorPath = "services/collector/event";
17+
internal const string DefaultCollectorPath = "services/collector";
1718
}
1819
}

src/Serilog.Sinks.Splunk/Sinks/Splunk/EventCollectorRequest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 Serilog Contributors
1+
// Copyright 2016 Serilog Contributors
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ internal class EventCollectorRequest : HttpRequestMessage
2323
{
2424
internal EventCollectorRequest(string splunkHost, string jsonPayLoad, string uri = ConfigurationDefaults.DefaultEventCollectorPath)
2525
{
26-
var hostUrl = splunkHost.Contains(ConfigurationDefaults.DefaultEventCollectorPath)
26+
var hostUrl = splunkHost.Contains(ConfigurationDefaults.DefaultCollectorPath)
2727
? splunkHost
2828
: $"{splunkHost.TrimEnd('/')}/{uri.TrimStart('/').TrimEnd('/')}";
2929

@@ -32,4 +32,4 @@ internal EventCollectorRequest(string splunkHost, string jsonPayLoad, string uri
3232
Method = HttpMethod.Post;
3333
}
3434
}
35-
}
35+
}

0 commit comments

Comments
 (0)