lib/conjur/command/audit.rb in conjur-cli-4.28.2 vs lib/conjur/command/audit.rb in conjur-cli-4.29.0

- old
+ new

@@ -136,8 +136,20 @@ audit.arg_name 'resource' audit_feed_command audit, :resource do |args, options| id = full_resource_id(require_arg args, "resource") api.audit_resource(id, options){|es| show_audit_events es, options} end + + audit.desc "Send custom event(s) to audit system" + audit.long_desc "Send custom event(s) to audit system. Events should be provided in JSON format, describing either single hash or array of hashes." + audit.arg_name "( json_string | STDIN )" + audit.command :send do |c| + c.action do |global_options, options, args| + json = ( args.shift || STDIN.read ) + api.audit_send json + puts "Events sent successfully" + end + end + end end end