Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given a log of the following format

2009-11-11 13:13:44,716 INFO Something happened : problem description . Waited 3 seconds
2009-11-11 13:23:44,716 INFO Something happened : problem description . Waited 1 second
2009-11-11 13:33:44,716 INFO Something happened : some other problem description .

How can I extract just the strings which are between : and .?

share|improve this question
up vote 3 down vote accepted

Maybe:

<logfile sed -e"s/^.* : \(.*\) \..*/\1/"
share|improve this answer
cat logfile | cut -f1 -d. | cut -f4 -d:
share|improve this answer

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.