Skip to content

Commit

Permalink
[irods#103] do not stringify pid
Browse files Browse the repository at this point in the history
  • Loading branch information
SwooshyCueb committed Nov 7, 2022
1 parent d704fbc commit 75cb68a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions libirods_rule_engine_plugin-audit_amqp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,17 @@ namespace
char host_name[MAX_NAME_LEN];
gethostname(host_name, MAX_NAME_LEN);

pid_t pid = getpid();

std::string msg_str;
std::string log_file;

try {
std::uint64_t time_ms = ts_clock::now().time_since_epoch() / std::chrono::milliseconds(1);
json_obj["@timestamp"] = time_ms;
json_obj["hostname"] = host_name;
json_obj["pid"] = std::to_string(pid);

pid_t pid = getpid();
json_obj["pid"] = pid;

json_obj["action"] = "START";

if (test_mode) {
Expand Down Expand Up @@ -288,7 +289,7 @@ namespace
json_obj["hostname"] = host_name;

pid_t pid = getpid();
json_obj["pid"] = std::to_string(pid);
json_obj["pid"] = pid;

json_obj["action"] = "STOP";

Expand Down Expand Up @@ -377,9 +378,7 @@ namespace
gethostname(host_name, MAX_NAME_LEN);
json_obj["hostname"] = host_name;

pid_t pid = getpid();
json_obj["pid"] = std::to_string(pid);

json_obj["pid"] = getpid();
json_obj["rule_name"] = _rn;

for (const auto& itr : _ps) {
Expand Down

0 comments on commit 75cb68a

Please sign in to comment.