2
이 syslog 항목에 대한 프로파일을 추출해야합니다.PCRE에서 POSIX 지원
May 11 09:35:59 server-0548 ea_appserver: env=ACPT profile=product_api java[31185]: 2017-05-11 09:35:59,210 server-0548 org.hibernate.internal.SessionFactoryImpl ServerService Thread Pool -- 51 HHH000008: JTASessionContext being used with JDBCTransactionFactory; auto-flush will not operate correctly with getCurrentSession()
PCRE에 대한 다음 정규식 작품
하지만 난 POSIX에 걸쳐 변환 할 수없는 것.
(?m)profile=(\S+)
내가
[^=]*$
및
.*profile=(.*)
을 시도했지만 두 단지
product_api
시도'프로필 = ([^ [: 공간 :]] +)'당신은 정말 POSIX ERE 정규식이 필요합니다. 이 정규식을 사용하는 방법과 위치를 표시하거나 알려주십시오. –
우리는 이것을 스플 렁크의 헤비 포워드 농장에서 사용하고 있습니다. 정규식은 데이터를 Splunk로 처리하기 전에 데이터 정렬을 돕는 것입니다. 이렇게하면 빠른 액세스를 위해 데이터를 정렬하는 데 도움이되며 다양한 보존 기간을 적용 할 수 있습니다. 그래서 rsyslog를 사용하고있었습니다. 아래의 내용은 20-nmon-performance.conf 파일의 내용입니다. – Naveen
은 $! usr! fullprofile = re_extract ($ msg, 'profile = ([^ [: space :]] +)', 0,0, 'no-profile'을 설정합니다. $! usr! profile = re_extract ($! usr! fullprofile, '[^ =] * $', 0,0, 'no-profile')를 설정하십시오. ################################ # 로직은 환경 유형에 따라 모든 응용 프로그램 데이터를 분할하는 ##### ############ $ prodLogs "/ vcaclog/PROD/% $! usr! profile %/% HOSTNAME % $ 템플릿 "/%programname%.log $의 programName을의 startswith 다음 'ea_appserver'? prodLogs 및이 \t을 중지하면 $의 MSG는 { 'ENV = PROD'를 포함하는 경우 경우 $의 programName을의 startswith 다음 'ea_loadbalancer'? prodLogs – Naveen