Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I recently learned about awk which has the simply ability to filter or output certain columns of a logfile with the print method.

Is there also an option how to suppress the output of certain columns in multitail and if yes how to do? I need it to make my logfile better readable.

share|improve this question
    
Instead of asking piecemail questions, you really should just work out of one and refine it. –  gWaldo Dec 26 '10 at 14:00
    
hi, the idea of using multitail for filtering i got after asking the other question, so i couldn't include it in the other question. I like to ask the question more specific because i'm interested in learning about special techniques and do not intend to get to general answers that doesn't answer my question. i would like to know how to suppress output of certain columns in multitail, because the documentation i found on the web doesn't help me much. i found that there 's an option -kc x y to suppress one column, but i doesn't succeed to define several columns to hide in multitail? –  NES Dec 26 '10 at 14:16

2 Answers 2

up vote 4 down vote accepted

You can use -kc x y to strip column y as delimited by x. You can use -kc multiple times too.

e.g. a line from an apache access log

89.149.244.193 - - [26/Dec/2010:10:50:52 +0000] "GET /admin/config.php HTTP/1.1" 404 495 "-" "Python-urllib/2.4"

and the same thing once it's been through -kc " " 1 -kc " " 2 -kc " " 3 -kc " " 4

89.149.244.193 "GET /admin/config.php HTTP/1.1" 404 495 "-" "Python-urllib/2.4"
share|improve this answer
    
thanks, i tried it with this command: multitail -kc 1 " " logfile.log. the columns in my logfile are delimited by whitespaces, is this the right syntax i use with whitespace in doublequotes, because i don't really understand what multitail expects to be a column. it seems not very similar to that was awk defines as a column? –  NES Dec 26 '10 at 14:35
    
@NES: You have the delimiter and column number the wrong way around. I added an example. –  Iain Dec 26 '10 at 14:38
    
@IAN thanks, now it works. –  NES Dec 26 '10 at 14:52

cat myfile | awk '{print $1 $2 ...}'

where $1 $2 are the columns you want to see, the rest will not show up is this what you want ?

share|improve this answer
    
not exactly. i'm searching for an option to do this with multitail because of it's features it seems to be very suitable for logfile analysis. –  NES Dec 26 '10 at 14:21
    
Good answer, silviud. +1 to you. –  gWaldo Dec 26 '10 at 14:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.