Ben kuyruğunaBaşkalarını işlenmemişken yalnızca bazı satırları nasıl kesiyorum?
Mar 22 23:26:18.793031 localhost my_process[1123]: (my_id) contents of actual log output
Mar 22 23:26:18.946769 localhost my_process[1123]: (my_id) more singe line contents
Mar 22 23:26:18.955423 localhost my_process[1123]: (my_id)
****
* this log statement has a bunch of lines
****
onlar kadar uzun olmayacak şekilde bu satırların dışarı önemsiz bir sürü kesmek istiyor benzer bir biçime sahip bir günlük dosyası istiyorum. Ancak, sadece diğer satırları tek başına bırakırken, sadece tarihle başlayan satırları kesmek istiyorum. Aşağıdaki gibi olmalıdır:
23:26:18 my_process[1123]: contents of actual log output
23:26:18 my_process[1123]: more singe line contents
23:26:18 my_process[1123]:
****
* this log statement has a bunch of lines
****
Bu benim ilerlediğim boru hattı, ancak tüm satırları kesiyor.
# first cut out the unwanted fields
# then cut out the unwanted decimal part of the timestamp
tail -f mylog.txt | cut -d " " -f 3,5,7- | cut -c 1-8,16-
Ben bu ortak tarih deseni ile başlar ve sadece işlenmemiş aracılığıyla bu satırları izin vermeyin hatları için görünebilir bir yolu var mı?
Teşekkür