我有json日志文件,但不仅有json
我需要剪切/删除所有不是json的内容,结构如下所示:
2010-10-10 10:10:10 vibez.dev and here starts json {xxxx:xxxx, etc}
when json ends, next line with same info begins.
我尝试了cut -d命令,但对我不起作用
最佳答案
尝试
sed -e 's/^.*\{/{/' [logfile]
这应该删除每行中第一个大括号之前的所有内容。