Effective grep of log file

前端 未结 4 1354
难免孤独
难免孤独 2021-01-22 19:41

I have a log file with a lot of lines on this format:

10.87.113.12 - - [2019-12-09T11:41:07.197Z] \"DELETE /page/sub1.php?id=alice HTTP/1.1\" 401 275 \"-\" \"ali         


        
4条回答
  •  春和景丽
    2021-01-22 20:10

    Would you try the following:

    grep "id=alice.* 200 " main.log | sed 's/.*jw_token=\([^ ]\{1,\}\).*/\1/' | uniq
    

提交回复
热议问题