Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 从tomcat日志中提取ORACLE错误列表_Linux_Bash_Tomcat - Fatal编程技术网

Linux 从tomcat日志中提取ORACLE错误列表

Linux 从tomcat日志中提取ORACLE错误列表,linux,bash,tomcat,Linux,Bash,Tomcat,寻找一些快速的帮助(希望如此);我正在寻找一种从tomcat日志中提取ORACLE错误的方法;比如说 INFO | jvm 1 | main | 2015/07/30 00:00:29.038 | Exception in thread "TaskExecutor-master-3734-ProcessTask [8799338038198]" com.business.platform.servicelayer.exceptions.ModelSavingException:

寻找一些快速的帮助(希望如此);我正在寻找一种从tomcat日志中提取ORACLE错误的方法;比如说

INFO | jvm 1 | main | 2015/07/30 00:00:29.038 | Exception in thread "TaskExecutor-master-3734-ProcessTask [8799338038198]" com.business.platform.servicelayer.exceptions.ModelSavingException: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (DATABASE.DATABASE_IDX_3) violated 信息| jvm 1 | main | 2015/07/30 00:00:29.038 |线程中的异常“TaskExecutor-master-3734-ProcessTask[8799338038198]”com.business.platform.servicelayer.exceptions.ModelSavingException:java.sql.SQLIntegrityConstraintViolationException:ORA-00001:违反了唯一约束(DATABASE.DATABASE_IDX_3) 我想做的是创建一个不同的Oracle错误列表作为其输出

输出示例:

ORA-00001 ORA-00932 ORA-00000 ORA-00001 ORA-00932 ORA-00000 有人有现成的剧本吗?谢谢你的帮助

使用GNU grep:

grep -oP ' \KORA-[0-9]{5}(?=:)' file
使用GNU grep:

grep -oP ' \KORA-[0-9]{5}(?=:)' file

非常感谢。刚刚添加了grep-oP'\KORA-[0-9]{5}(?=:)'文件| sort | uniq以使其唯一…:)如果您有权访问GNU sort,请用
sort-u
替换
sort | uniq
。谢谢!!!刚刚添加了grep-oP'\KORA-[0-9]{5}(?=:)'文件| sort | uniq以使其唯一…:)如果您有权访问GNU sort,请随意将
sort | uniq
替换为
sort-u