Skip to content

Commit 2c01caf

Browse files
Luca Marturanaluca3m
authored andcommitted
Add exitCode and signal attributes coming from die and kill events
1 parent 89af0b5 commit 2c01caf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

userspace/libsinsp/docker.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,13 @@ void docker::emit_event(Json::Value& root, std::string type, std::string status,
330330
{
331331
status.append("; ID: ").append(id);
332332
}
333-
const Json::Value& name = attrib["name"];
334-
if(!name.isNull() && name.isConvertibleTo(Json::stringValue))
333+
for(const auto attribute_name : {"name", "exitCode", "signal"})
335334
{
336-
status.append("; Name: ").append(name.asString());
335+
const Json::Value& name = attrib[attribute_name];
336+
if(!name.isNull() && name.isConvertibleTo(Json::stringValue))
337+
{
338+
status.append("; ").append(attribute_name).append(": ").append(name.asString());
339+
}
337340
}
338341
}
339342
}

0 commit comments

Comments
 (0)