I'm reading a log file line by line and I use "white spaces,\"(quotation),/(slash)" to split them.However,there are some lines which have more slash than others.EX:
173.172.12.134 - - [05/Oct/2015:06:37:26 +0300] "GET /h/8K/ID_0000012974.ism/QualityLevels(96000)/Fragments(audio=45302184354) HTTP/1.1" 200 25285 "-" "Firefox/1.5" "-" rt=0.000 ut="-" cs=HIT
When I do this strLine.split(" |\"")[7].split("/")[3]
---> this is what I want that content name>ID_0000012974.ism
But in this line:
98.207.17.70 - - [05/Oct/2015:06:47:40 +0300] "GET /clientaccesspolicy.xml HTTP/1.1" 304 0 "baba-candir-4-ekim" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.1.56 (KHTML, like Gecko) Version/9.0 Safari/601.1.56" "-" rt=0.000 ut="-" cs=HIT
I need this-->baba-candir-4-ekim as a content name.
I tried that if(strLine.split(" |\"")[7].split("/")[3].contains(" /|/|/"))
but it does not work.How can I check how many "/" does it have?