use strict;
my $str = 'Feb 5 23:30:09 netoapi-06ae0d2a778f6d96c neto-ecommerce[21749]: [Self=1-5c5a1c7f-1417875ef90160804e31a159;Root=1-5c5a1c78-c849bf9b2a5aa92ee1ffd501] [N015185] app.ERROR: Entity of type \'Neto\\ShopBundle\\Entity\\Country\' for IDs code() was not found [] {""tags"":[""sales_channels""]}"
Feb 5 23:10:00 cpanel-0b75ea0f831a1a35a neto-ecommerce[4987]: [Self=1-5c5a17c8-1b0a7d58cd923b42ff5a7412;Root=1-5c5a17c8-5432af944896f7d093992b3a] [N008907] app.ERROR: Uncaught PHP Exception Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException: ""Installation wizard is not supported for Amazon AU"" at /opt/release/Neto6.38.0/vendor/php/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php line 117 {""exception"":""[object] (Symfony\\\\Component\\\\HttpKernel\\\\Exception\\\\AccessDeniedHttpException(code: 0): Installation wizard is not supported for Amazon AU at /opt/release/Neto6.38.0/vendor/php/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php:117, Symfony\\\\Component\\\\Security\\\\Core\\\\Exception\\\\AccessDeniedException(code: 403): Installation wizard is not supported for Amazon AU at /opt/release/Neto6.38.0/vendor/php/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php:379)""} {""tags"":[""sales_channels""]}"
Feb 5 21:35:06 netoapi-050acc5cb696746e7 neto-ecommerce[31278]: [Self=1-5c5a0188-c0db1f2809ade66c634f9576;Root=1-5c5a0185-b02bf3209835c7a4df7e5c2c] [N015185] app.ERROR: Entity of type \'Neto\\ShopBundle\\Entity\\Country\' for IDs code() was not found [] {""tags"":[""sales_channels""]}"
Feb 6 05:59:30 netoapi-07743f4e14561df22 neto-ecommerce[5407]: [Self=1-5c5a77c1-0019eb7067e6cc30180f9770;Root=1-5c5a77a7-2fa7f778122a1698c2a7e286] [N016687] app.CRITICAL: Uncaught PHP Exception Doctrine\\DBAL\\Exception\\DriverException: "An exception occured in driver: SQLSTATE[HY000] [1203] User N016687_web already has more than \'max_user_connections\' active connections" at /opt/release/Neto6.38.0/vendor/php/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 {"exception":"[object] (Doctrine\\\\DBAL\\\\Exception\\\\DriverException(code: 0): An exception occured in driver: SQLSTATE[HY000] [1203] User N016687_web already has more than \'max_user_connections\' active connections at /opt/release/Neto6.38.0/vendor/php/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115, Doctrine\\\\DBAL\\\\Driver\\\\PDOException(code: 1203): SQLSTATE[HY000] [1203] User N016687_web already has more than \'max_user_connections\' active connections at /opt/release/Neto6.38.0/vendor/php/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:47, PDOException(code: 1203): SQLSTATE[HY000] [1203] User N016687_web already has more than \'max_user_connections\' active connections at /opt/release/Neto6.38.0/vendor/php/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43)"} {"tags":["sales_channels"]}';
my $regex = qr/(\w{3}\s\s\d{1,2} \d{2}:\d{2}:\d{2})\s(\S*)\s(\S*):\s\[(\S*)\]\s\[(\w\d{6})\]\s(\S*)\.(\w*):\s(.*)[\s|\s\[]({.*})/mp;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html