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

Allow empty JSON in exec plugin #2887

Closed
danielnelson opened this issue Jun 5, 2017 · 1 comment · Fixed by #3268
Closed

Allow empty JSON in exec plugin #2887

danielnelson opened this issue Jun 5, 2017 · 1 comment · Fixed by #3268
Milestone

Comments

@danielnelson
Copy link
Contributor

Feature Request

As suggested by @mjesse88, when using json data_format the output should be optional, similar to how the influx data_format works.

Proposal:

Current behavior:

test.bat

@echo off
exit /b 0
E! Error in plugin [inputs.exec]: unable to parse out as JSON, unexpected end of JSON input

2.test.bat

@echo off
echo ""
exit /b 0
E! Error in plugin [inputs.exec]: unable to parse out as JSON, json: cannot unmarshal string into Go value of type map[string]interface {}

Desired behavior:

No error or metric produced.

Use case: [Why is this important (helps with prioritizing requests)]

Sometime I don't need metrics write to influxdb, so my script output empty json,

@mjesse88
Copy link

mjesse88 commented Jun 6, 2017

Thanks for your attention

Jesse

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

Successfully merging a pull request may close this issue.

2 participants