Hi Team,
we are trying to add rules which add header contains random messageID via rules for all incoming request.
so please guide us how to create it.
is it possible to create above condition via rule builder or traffic scripts?
Solved! Go to Solution.
Are you looking to create a MessageID for use with SMTP, or for some other use? Or just to track unique transactions downstream? In general, you could create a random code to insert into a header, or a cookie, or into the response sent back to the client.
For example, this fragment uses a simple random sequence of eight bytes, hex-encoded:
# Random, suitable for cryptographic use $myMessageID = string.hexencode(string.randomBytes( 8 )); http.setHeader( "X-My-Header", $myMessageID );
Alternatively, this constructs an ID including micro-second timing and hostname:
# Random, machine id, date/time, hostname $myMessageID =
string.sprintf( "%.6f", sys.time.highres()) . "@" . sys.hostname() . "." . sys.domainname());
http.setHeader( "X-My-Header", $myMessageID );
Are you looking to simply log the MessageID in your SIEM, or to use it for additional processing?
For example, if you are looking to track the time taken individual transactions, you could use our analytics application with Services Director, or you could use connection tracing, as shown here:
Are you looking to create a MessageID for use with SMTP, or for some other use? Or just to track unique transactions downstream? In general, you could create a random code to insert into a header, or a cookie, or into the response sent back to the client.
For example, this fragment uses a simple random sequence of eight bytes, hex-encoded:
# Random, suitable for cryptographic use $myMessageID = string.hexencode(string.randomBytes( 8 )); http.setHeader( "X-My-Header", $myMessageID );
Alternatively, this constructs an ID including micro-second timing and hostname:
# Random, machine id, date/time, hostname $myMessageID =
string.sprintf( "%.6f", sys.time.highres()) . "@" . sys.hostname() . "." . sys.domainname());
http.setHeader( "X-My-Header", $myMessageID );
Are you looking to simply log the MessageID in your SIEM, or to use it for additional processing?
For example, if you are looking to track the time taken individual transactions, you could use our analytics application with Services Director, or you could use connection tracing, as shown here:
Thanks Team for the reply.
i will test the rule and reply back.
All i want one randon code to track the message transaction.
i think this code will work.