mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-08 10:09:40 +00:00
Fix missing arguments (#485)
* Fix missing arguments. sysdig-CLA-1.0-signed-off-by: Yue Feng <ztz5651483@gmail.com> falco-CLA-1.0-signed-off-by: Yue Feng <ztz5651483@gmail.com> * Re-add base64 encoding feature into formats.cpp sysdig-CLA-1.0-signed-off-by: Yue Feng <ztz5651483@gmail.com> falco-CLA-1.0-signed-off-by: Yue Feng <ztz5651483@gmail.com>
This commit is contained in:
@@ -152,7 +152,27 @@ int falco_formats::format_event (lua_State *ls)
|
|||||||
|
|
||||||
if(s_json_output)
|
if(s_json_output)
|
||||||
{
|
{
|
||||||
|
switch(s_inspector->get_buffer_format())
|
||||||
|
{
|
||||||
|
case sinsp_evt::PF_NORMAL:
|
||||||
s_inspector->set_buffer_format(sinsp_evt::PF_JSON);
|
s_inspector->set_buffer_format(sinsp_evt::PF_JSON);
|
||||||
|
break;
|
||||||
|
case sinsp_evt::PF_EOLS:
|
||||||
|
s_inspector->set_buffer_format(sinsp_evt::PF_JSONEOLS);
|
||||||
|
break;
|
||||||
|
case sinsp_evt::PF_HEX:
|
||||||
|
s_inspector->set_buffer_format(sinsp_evt::PF_JSONHEX);
|
||||||
|
break;
|
||||||
|
case sinsp_evt::PF_HEXASCII:
|
||||||
|
s_inspector->set_buffer_format(sinsp_evt::PF_JSONHEXASCII);
|
||||||
|
break;
|
||||||
|
case sinsp_evt::PF_BASE64:
|
||||||
|
s_inspector->set_buffer_format(sinsp_evt::PF_JSONBASE64);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// do nothing
|
||||||
|
break;
|
||||||
|
}
|
||||||
s_formatters->tostring((sinsp_evt *) evt, sformat, &json_line);
|
s_formatters->tostring((sinsp_evt *) evt, sformat, &json_line);
|
||||||
|
|
||||||
// The formatted string might have a leading newline. If it does, remove it.
|
// The formatted string might have a leading newline. If it does, remove it.
|
||||||
@@ -160,8 +180,6 @@ int falco_formats::format_event (lua_State *ls)
|
|||||||
{
|
{
|
||||||
json_line.erase(0, 1);
|
json_line.erase(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
s_inspector->set_buffer_format(sinsp_evt::PF_NORMAL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (sinsp_exception& e)
|
catch (sinsp_exception& e)
|
||||||
|
@@ -458,6 +458,7 @@ int falco_init(int argc, char **argv)
|
|||||||
static struct option long_options[] =
|
static struct option long_options[] =
|
||||||
{
|
{
|
||||||
{"help", no_argument, 0, 'h' },
|
{"help", no_argument, 0, 'h' },
|
||||||
|
{"print-base64", no_argument, 0, 'b'},
|
||||||
{"daemon", no_argument, 0, 'd' },
|
{"daemon", no_argument, 0, 'd' },
|
||||||
{"k8s-api", required_argument, 0, 'k'},
|
{"k8s-api", required_argument, 0, 'k'},
|
||||||
{"k8s-api-cert", required_argument, 0, 'K' },
|
{"k8s-api-cert", required_argument, 0, 'K' },
|
||||||
@@ -488,7 +489,7 @@ int falco_init(int argc, char **argv)
|
|||||||
// Parse the args
|
// Parse the args
|
||||||
//
|
//
|
||||||
while((op = getopt_long(argc, argv,
|
while((op = getopt_long(argc, argv,
|
||||||
"hc:AdD:e:ik:K:Ll:m:M:o:P:p:r:s:T:t:UvV:w:",
|
"hc:AbdD:e:F:ik:K:Ll:m:M:o:P:p:r:S:s:T:t:UvV:w:",
|
||||||
long_options, &long_index)) != -1)
|
long_options, &long_index)) != -1)
|
||||||
{
|
{
|
||||||
switch(op)
|
switch(op)
|
||||||
|
Reference in New Issue
Block a user