Sha256: 93d9f9922796a2a781c197f2512182ea720f098d3bd36521e459d674cb57507e

Contents?: true

Size: 777 Bytes

Versions: 4

Compression:

Stored size: 777 Bytes

Contents

package org.embulk.parser.apache.log;


import org.apache.commons.lang3.StringUtils;

public class StringLogElementFactory implements LogElementFactory<StringLogElement>, Patterns {

    private String name;
    private String regexp;

    public StringLogElementFactory(String name, String regexp) {
        this.name = name;
        this.regexp = regexp;
    }

    public StringLogElementFactory(String name) {
        this.name = name;
        this.regexp = ANY;
    }

    @Override
    public StringLogElement create(String parameter) {
        if(StringUtils.isEmpty(parameter)){
            return new StringLogElement(name, regexp);
        }else{
            return new StringLogElement(name + "-" + parameter, regexp);
        }
    }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
embulk-parser-apache-custom-log-0.4.1 src/main/java/org/embulk/parser/apache/log/StringLogElementFactory.java
embulk-parser-apache-custom-log-0.4.0 src/main/java/org/embulk/parser/apache/log/StringLogElementFactory.java
embulk-parser-apache-custom-log-0.3.0 src/main/java/org/embulk/parser/apache/log/StringLogElementFactory.java
embulk-parser-apache-custom-log-0.2.0 src/main/java/org/embulk/parser/apache/log/StringLogElementFactory.java