Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Search key word only from string start with specific word?

I need to match key words from many string like from log so can you suggest me pattern to search the key word from a log of start from specific word only.

Like:

Message=102.149.82.41 - - [30/Nov/2018:04:17:21 +0000] "GET /documents/10184/11130/Malware+Propagation+Methods/8f2d1f07-f83f-42a3-8577-e322419e57c3?version=1.0 HTTP/1.1" 200 97414 

staring with Message= only logs and match key word GET,How can I write pattern match this.

const std::string s4="Message=ERROR 2018-11-23-14:52:47,710 | geezmail.smtpserver | Id='1535935049' User='' OR  AUTH method LOGIN failed from taylor@177.143.199.94";
boost::regex rgx(".*WHERE.*|.*AND.*|.*OR.*|.*UNION.*|.*where.*|.*or.*|.*union.*");

boost::smatch match;

if (boost::regex_search(s4.begin(), s4.end(), match, rgx))
{
    std::cout << "regex_search: match s\n";
    std::cout <<s<<endl;
}

Comments