Skip to content

Commit b3dcaa5

Browse files
committed
Send HEC auth via query string
#38
1 parent 2aa8364 commit b3dcaa5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/SplunkLogger/Providers/SplunkHECBaseProvider.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ Uri GetSplunkCollectorUrl(SplunkLoggerConfiguration configuration, string endPoi
6262
if (configuration.HecConfiguration.ChannelIdType == HECConfiguration.ChannelIdOption.QueryString)
6363
splunkCollectorUrl = splunkCollectorUrl + "?channel=" + Guid.NewGuid().ToString();
6464

65+
if(configuration.HecConfiguration.UseAuthTokenAsQueryString)
66+
{
67+
var tokenParameter = "token=" + configuration.HecConfiguration.Token;
68+
splunkCollectorUrl = string.Format("{0}{1}{2}", splunkCollectorUrl, splunkCollectorUrl.Contains("?") ? "&" : "?", tokenParameter);
69+
}
70+
6571
return new Uri(splunkCollectorUrl);
6672
}
6773
}

0 commit comments

Comments
 (0)