cancel
Showing results for 
Search instead for 
Did you mean: 

how to add header with help of rules which creates messageID for each Request in Virtual server

Highlighted
Occasional Visitor

how to add header with help of rules which creates messageID for each Request in Virtual server

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?

Tags (2)
1 REPLY 1
Highlighted
Community Manager

Re: how to add header with help of rules which creates messageID for each Request in Virtual server

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:

https://community.pulsesecure.net/t5/Pulse-Secure-vADC/Finding-a-needle-in-your-haystack-using-the-c...