MD5

Learn about the MD5 OTTL converter function.

The MD5 converter hashes a string using the MD5 hashing algorithm.

Syntax: MD5(value)

  • value: the bracket notation location of the string field to hash

Input

{
	"_type": "log",
	"timestamp": 1734491967419,
	"body": "time=hostname=SIMPLE|product=Firewall1",
	"resource": {...},
	"attributes": {
		"decoded_body": "time=hostname=SIMPLE|product=Firewall1"
	}
}

Statement

set(attributes["data_hash"], MD5(attributes["decoded_body"]))

Output

{
	"_type": "log",
	"timestamp": 1734492005310,
	"body": "time=hostname=SIMPLE|product=Firewall1",
	"resource": {...},
	"attributes": {
		"data_hash": "2a6a4623ccbdb37abeb4eb3902a8acad",
		"decoded_body": "time=hostname=SIMPLE|product=Firewall1"
	}
}

The string decoded_body-data was hashed using MD5 resulting in data_hash.