Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $patterns = [
- 'mailid' => '/postfix\/smtp\[\w+\]:\s(\w+)/',
- 'mailto' => '/to=<(.*?)>/',
- 'datetime' => '/(\w+\s+\w+\s+\w+:\w+:\w+)/',
- 'host' => '/.*?\(host\s(.*?)\[.*/',
- 'hostip' => '/.*?\(host\s.*?\[(.*?)\]\s.*/',
- 'reason' => '/status=\w+\s(.*)/',
- ];
- $data = [];
- foreach ($patterns as $key => $pattern) {
- preg_match_all($pattern, $output, $matches);
- $data[$key] = $matches[1];
- }
- header('Content-Type: application/json');
- echo json_encode($data);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement