public void Write(ProcessObservation o)
        {
            var point = new LineProtocolPoint(table,
                                              new Dictionary <string, object> {
                { "process_id", o.ProcessID },
                { "parent_process_id", o.ParentProcessID }
            },
                                              new Dictionary <string, string> {
                { "process_name", o.ProcessName },
                { "event_name", o.EventName },
                { "host", host }
            },
                                              o.TimeCreated
                                              );

            var payload = new LineProtocolPayload();

            payload.Add(point);

            var result = client.WriteAsync(payload).Result;

            if (!result.Success)
            {
                Console.Error.WriteLine(result.ErrorMessage);
            }
        }
Exemplo n.º 2
0
 static void ToConsole(ProcessObservation o)
 {
     Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")}: {o.EventName} {o.ProcessName} [parent:{o.ParentProcessID}->id:{o.ProcessID}]");
 }