Search text if some part sequence exists
by pedropt from LinuxQuestions.org on (#4S3AJ)
Hi guys , i dont even know how to write the topic to match what i need .
Here it is , i am writing a definition file with errors messages appears in my web log servers .
Example of def.conf
Quote:
Now in web server log this line could be in many forms but that specific sequence is there , by this i mean :
Quote:
Now , when i put my script searching the definition log , i will use the variable i have in the log , witch is :
"/index.php/module/action/param1 ${@die(md5(HelloThinkPHP))}"
and i want the script to identify that this line belongs to "/module/action/param1 ${@die(md5(HelloThinkPHP))}" , and then i will retrieve with awk the variable $1 witch is ThinkPHP_RCE.
How can i do this ?


Here it is , i am writing a definition file with errors messages appears in my web log servers .
Example of def.conf
Quote:
| ThinkPHP_RCE /module/action/param1 ${@die(md5(HelloThinkPHP))} |
Quote:
| 111.111.111.111 "GET /index.php/module/action/param1 ${@die(md5(HelloThinkPHP))}" 111.111.111.111 "GET /something//module/action/param1 ${@die(md5(HelloThinkPHP))} |
Now , when i put my script searching the definition log , i will use the variable i have in the log , witch is :
"/index.php/module/action/param1 ${@die(md5(HelloThinkPHP))}"
and i want the script to identify that this line belongs to "/module/action/param1 ${@die(md5(HelloThinkPHP))}" , and then i will retrieve with awk the variable $1 witch is ThinkPHP_RCE.
How can i do this ?