Sha256: c099c005b972ec4ff38476c6bfb5336a9c76e99c95f6c4ffd98b3b1d4c7ac787

Contents?: true

Size: 743 Bytes

Versions: 4

Compression:

Stored size: 743 Bytes

Contents

package org.embulk.parser.apache.log;


import org.embulk.spi.PageBuilder;
import org.embulk.spi.type.Types;

public class StringLogElement extends LogElement<String> {

    public StringLogElement(String name, String regex) {
        super(name, regex, Types.STRING);
    }

    @Override
    public String parse(String s) {
        if("-".equals(s)){
            return null;
        }else{
            return s;
        }

    }

    @Override
    public void setToPageBuilder(PageBuilder pageBuilder, int i, String value) {
        String parsed = parse(value);
        if(parsed != null){
            pageBuilder.setString(i, parsed);
        }else{
            pageBuilder.setNull(i);
        }

    }
}

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/StringLogElement.java
embulk-parser-apache-custom-log-0.4.0 src/main/java/org/embulk/parser/apache/log/StringLogElement.java
embulk-parser-apache-custom-log-0.3.0 src/main/java/org/embulk/parser/apache/log/StringLogElement.java
embulk-parser-apache-custom-log-0.2.0 src/main/java/org/embulk/parser/apache/log/StringLogElement.java