hey guys :) i have a file with a very huge amount of datas ( access logs ) and i have a little problem there.. i want to save all the access logs i have in a database.. and i was able to filter nearly all important data ein need.. besides one and this is my problem... so imagine :
$domain = system(" awk '{print $1}' /var/www/laravel/xxxxxx/xxxxx/xxxxxxx.log");
$1 is the domain - and $2-6 are other datas i need.. but now my problem is that $7 is a important string and i can filter it like i need.. so my first log goes from $7 to $11 - but the seccond log ( from this important string ) goes from $7 to $13 - and now i cant filter them in a right way :/
the only think maybe could help is that this important data is around some ' ( ) '
now i need a command that cuts me every string from the first ( until the last ) - but this important string looks on some logs like this :
( 11111 22222 ) ( 33333 444444)
so i want the whole content from the ' ( ' before 111111 until the ' ) ' after the 4444444
do anyone know how to do this with sed, grep or something else?