package org.ctrip.ops.sysdev.filters;

import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;

public class Uppercase extends BaseFilter {
	public Uppercase(Map config, ArrayBlockingQueue inputQueue) {
		super(config, inputQueue);
	}

	private String src;

	protected void prepare() {
		this.src = (String) config.get("src");
	};

	@Override
	protected Map filter(Map event) {
		if (event.containsKey(this.src)) {
			event.put(this.src, ((String) event.get(src)).toUpperCase());
		}
		return event;
	}
}

package org.ctrip.ops.sysdev.filters;

import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;

public class Uppercase extends BaseFilter {
	public Uppercase(Map config, ArrayBlockingQueue inputQueue) {
		super(config, inputQueue);
	}

	private ArrayList<String> fields;

	protected void prepare() {
		this.fields = (ArrayList<String>) config.get("fields");
	};

	@Override
	protected Map filter(Map event) {
		for (String field : fields) {
			if (event.containsKey(field)) {
				event.put(field, ((String) event.get(field)).toUpperCase());
			}
		}

		return event;
	}
}

fix bug