Regular Expressions 101

Community Patterns

IP and Timestamp extractor

0

Regular Expression
PCRE (PHP <7.3)

/
(\d{4}\-\d{1,2}\-\d{1,2} \d{2}:\d{2}:\d{2})(.*)(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)
/
gm

Description

extracts IP and Timestamp from log file for further processing.

Submitted by anonymous - 5 years ago