MCPcopy Index your code
hub / github.com/microsoft/retina / generateJSONOutput

Method generateJSONOutput

shell/tracescript.go:587–595  ·  view source on GitHub ↗

generateJSONOutput generates printf for JSON format.

()

Source from the content-addressed store, hash-verified

585
586// generateJSONOutput generates printf for JSON format.
587func (g *ScriptGenerator) generateJSONOutput() string {
588 return ` // Output JSON with numeric reason code
589 printf("{\"time\":\"%s\",\"type\":\"DROP\",\"reason_code\":%d,\"probe\":\"kfree_skb\",\"src_ip\":\"%s\",\"src_port\":%d,\"dst_ip\":\"%s\",\"dst_port\":%d}\n",
590 strftime("%H:%M:%S", nsecs),
591 $reason,
592 $saddr, $sport,
593 $daddr, $dport);
594`
595}
596
597// generateEndBlock creates the END block.
598func (g *ScriptGenerator) generateEndBlock() string {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected