/** * Copyright 2015 StreamSets Inc. * * Licensed under the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.streamsets.pipeline.lib.parser.log; public class Constants { public static final String REG_EX_STRING = "(\\S+)"; public static final String REG_EX_REQUEST_LINE = "(\\S+ \\S+ \\S+)"; public static final String REG_EX_REQUEST_TIME = "\\[([\\w:/]+\\s[+\\-]\\d{4})\\]"; public static final String REG_EX_STATUS = "(\\d{3})"; public static final String REG_EX_NUMBER = "(\\d+)"; public static final String REG_EX_URL = "([^\"]*)"; public static final String REG_EX_PERCENTAGE = "%"; public static final String REG_EX_NEW_LINE = "\\\\n"; public static final String GROK_PATTERNS_FILE_NAME = "grok-patterns"; public static final String GROK_APACHE_ERROR_LOG_PATTERNS_FILE_NAME = "apache-error-log"; public static final String GROK_TOMCAT_LOG_PATTERNS_FILE_NAME = "tomcat-log"; public static final String GROK_JAVA_LOG_PATTERNS_FILE_NAME = "java-log"; public static final String GROK_LOG4J_LOG_PATTERNS_FILE_NAME = "log4j-log"; public static final String GROK_COMMON_APACHE_LOG_FORMAT = "%{COMMONAPACHELOG}"; public static final String GROK_COMBINED_APACHE_LOG_FORMAT = "%{COMBINEDAPACHELOG}"; public static final String GROK_APACHE_ERROR_LOG_FORMAT = "%{APACHE_ERROR_LOG}"; public static final String GROK_LOG4J_LOG_FORMAT = "%{LOG4JLOG}"; //Field names generated by grok patterns, listed here to be used in unit tests public static final String ORIGINAL_LINE = "originalLine"; public static final String TIMESTAMP = "timestamp"; public static final String CLIENTIP = "clientip"; public static final String MESSAGE = "message"; public static final String LOGLEVEL = "loglevel"; public static final String USER_IDENT = "ident"; public static final String USER_AUTH = "auth"; public static final String VERB = "verb"; public static final String REQUEST = "request"; public static final String HTTPVERSION = "httpversion"; public static final String RAWREQUEST = "rawrequest"; public static final String RESPONSE = "response"; public static final String BYTES = "bytes"; public static final String REFERRER = "referrer"; public static final String AGENT = "agent"; public static final String SEVERITY = "severity"; public static final String JAVACLASS = "class"; public static final String CATEGORY = "category"; public static final String THREAD = "thread"; public static final String RELATIVETIME = "relativetime"; private Constants() {} }