Hi how can I extract only last 2 word that exist in className
I have log like this:
2022-05-24 16:29:51,918 INFO [APP] [ActionName] className[xx.xx.xxx.xxxx.xxx.session.controller.SearchClusterFinancialTcpMBean.search] status[done]
2022-05-24 16:29:51,918 INFO [APP] [ActionName] className[xx.xx.xxx.xxxx.xxx.session.controller.SearchClusterFinancialTcpMBean.search.attribute] status[done]
excpected output:
SearchClusterFinancialTcpMBean.search
search.attribute
Any idea?
Thanks,
This regular expression should do it.
className\[.*?(?<lastTwo>[^\.]+\.[^\.]+?)]
| rex "className.*\.(?<class>\w+\.\w+)\]"
This regular expression should do it.
className\[.*?(?<lastTwo>[^\.]+\.[^\.]+?)]