Need to filter and show log lines, if line contains exactly 2 commas, and does not contains a specific string. Which linux command need I use, awk
, grep
, what is the expression?
For second condition I use this:
awk '!/specificstring/' ./log/file/path
Two comma check I do not know how to put in. Usually line is like this two:
arbitrary,arbitrary,arbitrary,arbitrary
arbitrary,arbitrary,arbitrary
Need the second type of line.
Tried something like this:
grep -P '[^,]+[,][^,]+[,][^,]+[,]"specificstring"[^,]+' ./log/file/path
How to exclude "specificstring"?