fix(userspace): avoid using std namespace in sources

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
Jason Dellaluce
2022-12-03 17:03:03 +00:00
committed by poiana
parent 54f117141b
commit eaeec7c079
30 changed files with 184 additions and 199 deletions

View File

@@ -33,11 +33,11 @@ falco_formats::~falco_formats()
{
}
string falco_formats::format_event(gen_event *evt, const std::string &rule, const std::string &source,
std::string falco_formats::format_event(gen_event *evt, const std::string &rule, const std::string &source,
const std::string &level, const std::string &format, std::set<std::string> &tags,
const std::string &hostname) const
{
string line;
std::string line;
std::shared_ptr<gen_event_formatter> formatter;
@@ -48,7 +48,7 @@ string falco_formats::format_event(gen_event *evt, const std::string &rule, cons
if(formatter->get_output_format() == gen_event_formatter::OF_JSON)
{
string json_line;
std::string json_line;
// Format the event into a json object with all fields resolved
formatter->tostring(evt, json_line);
@@ -67,14 +67,14 @@ string falco_formats::format_event(gen_event *evt, const std::string &rule, cons
Json::Value event;
Json::Value rule_tags;
Json::FastWriter writer;
string full_line;
std::string full_line;
unsigned int rule_tags_idx = 0;
// Convert the time-as-nanoseconds to a more json-friendly ISO8601.
time_t evttime = evt->get_ts() / 1000000000;
char time_sec[20]; // sizeof "YYYY-MM-DDTHH:MM:SS"
char time_ns[12]; // sizeof ".sssssssssZ"
string iso8601evttime;
std::string iso8601evttime;
strftime(time_sec, sizeof(time_sec), "%FT%T", gmtime(&evttime));
snprintf(time_ns, sizeof(time_ns), ".%09luZ", evt->get_ts() % 1000000000);
@@ -131,14 +131,14 @@ string falco_formats::format_event(gen_event *evt, const std::string &rule, cons
return line.c_str();
}
map<string, string> falco_formats::get_field_values(gen_event *evt, const std::string &source,
std::map<std::string, std::string> falco_formats::get_field_values(gen_event *evt, const std::string &source,
const std::string &format) const
{
std::shared_ptr<gen_event_formatter> formatter;
formatter = m_falco_engine->create_formatter(source, format);
map<string, string> ret;
std::map<std::string, std::string> ret;
if (! formatter->get_field_values(evt, ret))
{