Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompactJsonFormatter is not working with Splunk EventCollector Sink #52

Closed
avireddy02 opened this issue May 24, 2017 · 5 comments
Closed

Comments

@avireddy02
Copy link
Contributor

avireddy02 commented May 24, 2017

Splunk EventCollector Sink is not working with CompactJsonFormatter. Looks like it's not generating Event attribute.

Error: A status code of BadRequest was received when attempting to send to http://localhost:8088/services/collector. The event has been discarded and will not be placed back in the queue.

@merbla
Copy link
Contributor

merbla commented May 24, 2017

Hi @avireddy02,

The BAD Request will be related to the CompactJsonFormatter not creating the payload as per the HEC endpoint definition. See these links.

By default, a formatter is included with the Sink here.

In particular check out this line, you can see some specific properties set in the JSON.

HTH.

@merbla
Copy link
Contributor

merbla commented May 24, 2017

@avireddy02 if you think a compact formatter is worthwhile, please feel free to submit a PR with a subclassed formatter specific for Splunk.

merbla added a commit that referenced this issue May 25, 2017
Added new CompactSplunkJsonFormatter from #52
@merbla merbla mentioned this issue May 25, 2017
@merbla
Copy link
Contributor

merbla commented Jun 16, 2017

Fixed in #57

@merbla merbla closed this as completed Jun 16, 2017
@avireddy02
Copy link
Contributor Author

@merbla

public CompactSplunkJsonFormatter(bool renderTemplate = false, string source = null, string sourceType = null, string host = null, string index = null)

When host is not specified, can we default host to Dns.GetHostName()?

@merbla
Copy link
Contributor

merbla commented Jun 22, 2017

That sounds reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants