...
Preprocessing framework으로 python 2.6 버전을 사용한다. 이 버전의 python은 마크베이스 서버와 같이 설치된 것을 사용하는 것을 추천한다. 설치된 python은 $MACH_COLLECTOR_HOME/webadmin/flask/Python/bin 경로에 있다. Python 라이브러리 추가 설치를 위한 python 실행도 위 디렉토리에서 실행해야 기존에 설치되어 있는 다른 버전의 python과 충돌을 방지할 수 있다. 마크베이스 collector와 같이 제공된 python을 기본으로 사용하려면 path환경변수를 정확히 설정하고, USER_PROCESS_LIB_PATH를 설정하여야 한다. USER_PROCESS_LIB_PATH에 추가 경로를 등록하려면, ":"문자를 path값의 분리를 위해서 path값 사이에 추가해야 한다.
In order to keep compatible with preprocessing framework, Python is strongly recommended to use. Python is included in webadmin of the package. The 2.6 version of Python should be used and can be found in $MACH_COLLECTOR_HOME/webadmin/flask/Python/bin. It is recommended to execute setup scripts via Python in the directory in order to prevent issues due to different versions of Python when you are using additional libraries. Python included in the package is not default version so that you need to add the library path of the added modules. The path will be registered in the environment variable and it will be predefined in USER_PREPROCESS_LIB_PATH as the existing path of Python cannot be used again. It will be defined in USER_PREPROCESS_LIB_PATH in the format of : just like other methods. When additional paths are required to add to the existing path, use " : " symbol to separate the paths.
Preprocessing 순서
Log 데이터를 변환 및 조작하기 위한 preprocessor 실행 순서를 기술한다. User-defined log 수집에서 사용된 것과 동일한 diagram을 이용하여 설명한다.
...
원본 로그 데이터 파일에 데이터가 입력되면 각 로그 데이터는 로그 unit단위로 분리된다. 이 분리된 데이터를 origin_msg로 명명한다. 각 origin_msg는 한번에 하나씩 위에 표시된 프로세스를 진행한다. 위 그림(그림이 없다.)에서 입력된 예를 들어 입력된 첫번째 메시지는 "Aug 19 15:37:12 localhost NetworkManager[1340]: (eth1): bringing up device." 이다.라고 하면,
입력된 origin_msg는 정규 표현식에 의해 토큰으로 분리된다. 이를 메시지 파싱이라고 한다. 메시지 파싱 이전에 origin_msg를 선처리 할 수 있다. 만약 origin_msg를 선처리 스크립트를 이용하여 변경한다면, 변경된 메시지가 파싱될 수 있도록 주의하여야 한다.
...