I am watching log traffic and see regular abuse of the various image search engines, Bing particularly.
I want to pull out the search itself, the "dagger genesis solo".
grep -o '=*'
but that leaves the = sign and everything that follows the search.
I want to grab everything between "search?q=" and the first "&" the end of the last word preceded by a "+".
I could get there in a very long and convoluted way using awk or cut to get strip as much of my string away as possible, and then use specified field separators to put each word in its own column and then print only those columns. But even that method wouldn't be consistent as the searches can be any length and include just about any character.
I am thinking there is a much easier way though. Ideas?
My final goal is to strip the search queries and collate them into unique entries.