Email and SSN regex patterns for elastic search


I am trying to recognize Email ids and SSNs in files using elastic search.
Could somebody tell me the correct regexp patterns to recognize SSN and Email ids.
I am using these below patterns:
Email: "[a-zA-Z0-9]+@[a-zA-Z]+.[a-zA-Z]+"
SSN: "[0-9]{3}-?[0-9]{2}-?[0-9]{4}"

Please correct me if I am wrong!!



you could try using a grok processor and use the EMAILADDRESS pattern, so you don't need to write the regex yourself. Not too sure about the SSN though, if there is a predefined regex.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.