diff --git a/types/datasource/proctree.go b/types/datasource/proctree.go index d034bdcef905..c01cec81211c 100644 --- a/types/datasource/proctree.go +++ b/types/datasource/proctree.go @@ -1,6 +1,7 @@ package datasource import ( + "strconv" "time" ) @@ -60,6 +61,16 @@ type FileInfo struct { // The lineage is only relevant for the container the process resides in. type ProcessLineage []TimeRelevantInfo[ProcessInfo] +// ToMap is the way to implement the detect.FindingDataStruct interface +func (pl ProcessLineage) ToMap() map[string]interface{} { + lmap := make(map[string]interface{}, len(pl)) + for i, ti := range pl { + lmap[strconv.Itoa(i)] = ti + } + + return lmap +} + // ProcKey is a key to the process tree data source, which will result receiving ProcessInfo in the // response for the matching process in the given time. type ProcKey struct {