Use simple grep and redirection. For example find all occurance of error and store to /tmp/error.log file
Code:
grep -i 'error' /var/log/message > /tmp/error.log
Rest of the implementation is depend upon what you would like to write.. let us know the details.