-
Notifications
You must be signed in to change notification settings - Fork 22
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
Read CE from stdin, or file given by --from
option
#30
Comments
The
will produce a CE with data of: {
"user": {
"email": "[email protected]",
"name": "John Doe",
},
"score": 154002
} By the way. I also think the One could create an event template using Maybe I didn't get what you'd like to see here. Could you rephrase, so I can understand better? |
Accepting stdin would be neat. Currently I pipe build output to curl which does support |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale |
This issue is stale because it has been open for 90 days with no |
At @rhuss: The issue description is misleading to me. I think you've been mistaken on how Still, I think the option to provide data from STDIN is a good idea. But, that would rather be a different issue. Or just reword this one. |
Yeah, maybe I misunderstood the Can you specify the full data directly with a |
Yes, the For setting custom CE fields, I thought we could add The design docs mention WDYT @rhuss? |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale ping @rhuss |
So, why not just |
The vision doc has a templating section, which boils down to the I think the |
I would love to see an option to import the CE data only, not the full CE. This is especially useful for complex JSON payload. So I still would like a |
This issue is stale because it has been open for 90 days with no |
@cardil is |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale |
Yes. I want to do that. In fact, the send command may read the stdin by default and expect there an event in JSON format. This creates a nice and clean Unix-friendly flow:
User might change that behavior with a new
By adding the new
(The above example will build a basic CE with I'll update the issue title and description accordingly. Thanks, @rhuss, for inspiration! /triage accepted |
--from
option
Summary
Introduce the
--from
option for build and send commands, which a user can use to load CE from a file. The option defaults to-
, which means the STDIN. Introduce the--from-format
option as well, which defaults tojson
.Description
The send and build commands may read the STDIN by default and expect there an event in JSON format.
This creates a nice and clean Unix-friendly flow:
User might change that behavior with a new
--from
option:By adding the new
--from
option to thebuild
sub-command as well, we could remove the event building options fromsend
sub-command and keep nice and easy flow even for complex things (also with detecting tty on stdin/stdout we can automatically use json format instead of human-readable format):(The above example will build a basic CE with
a.b.c=foo
data, pass it to some command in JSON format, then adda.d=bar
fields, and finally send it to K8s pod called event-sender)Original description by @rhuss:
The text was updated successfully, but these errors were encountered: