Trim special characters from string

%3CLINGO-SUB%20id%3D%22lingo-sub-1791459%22%20slang%3D%22en-US%22%3ETrim%20special%20characters%20from%20string%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1791459%22%20slang%3D%22en-US%22%3E%3CP%3EIssue%3A%20I%20got%20a%20Proofpoint%20TAP%20presenting%20logs%20with%20email%20recipient_s%20with%20unwanted%20characters%20as%20so%20%5B%22samuel.banahene%40hotmail.com%22%5D%20instead%20of%20samuel.banahene%40hotmail.com.%3CBR%20%2F%3EIn%20trying%20to%20remove%20the%20%5B%5D%2C%22%20characters%2C%20I%20was%20only%20able%20to%20use%20the%20trim%20function%20to%20remove%20the%20%5D%20at%20the%20end%2C%20with%20the%20syntax%20below.%3C%2FP%3E%3CP%3EProofPointTAPMessagesDelivered_CL%3CBR%20%2F%3E%7C%20extend%20Recipient%20%3D%20trim(%40%22%5D%22%2C%20recipient_s)%3CBR%20%2F%3E%7C%20project%20Recipient%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewhen%20I%20changed%20the%20%5D%20to%20%5B%20to%20get%20rid%20of%20the%20leading%20character%2C%20I%20got%20an%20error%3A%3C%2FP%3E%3CP%3Etrim()%3A%20argument%20%231%20must%20be%20a%20string%20literal%20evaluating%20to%20a%20valid%20regular%20expression%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20guess%20the%20simplest%20question%20is%20how%20would%20I%20remove%20the%20unwanted%20characters%20from%20a%20dynamic%20array%20of%20(%5B%22recipient_s%22%5D)%20to%20get%20recipients_s%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20help%20is%20very%20much%20appreciated%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Issue: I got a Proofpoint TAP presenting logs with email recipient_s with unwanted characters as so ["samuel.banahene@hotmail.com"] instead of samuel.banahene@hotmail.com.
In trying to remove the []," characters, I was only able to use the trim function to remove the ] at the end, with the syntax below.

ProofPointTAPMessagesDelivered_CL
| extend Recipient = trim(@"]", recipient_s)
| project Recipient

 

when I changed the ] to [ to get rid of the leading character, I got an error:

trim(): argument #1 must be a string literal evaluating to a valid regular expression

 

I guess the simplest question is how would I remove the unwanted characters from a dynamic array of (["recipient_s"]) to get recipients_s ?

 

Your help is very much appreciated

0 Replies