Package org.apache.camel.component.splunk.event

Examples of org.apache.camel.component.splunk.event.SplunkEvent.addPair()


    @Override
    public void process(Exchange exchange) throws Exception {
        SplunkEvent splunkEvent = new SplunkEvent();

        splunkEvent.addPair("ERRORKEY", "AVUA123");
        splunkEvent.addPair("ERRORMSG", "Service ABC Failed");
        splunkEvent.addPair("ERRORDESC", "BusinessException: Username and password don't match");
        splunkEvent.addPair(SplunkEvent.COMMON_START_TIME, "Thu Aug 15 2014 00:15:06");

        exchange.getIn().setBody(splunkEvent, SplunkEvent.class);
View Full Code Here


    @Override
    public void process(Exchange exchange) throws Exception {
        SplunkEvent splunkEvent = new SplunkEvent();

        splunkEvent.addPair("ERRORKEY", "AVUA123");
        splunkEvent.addPair("ERRORMSG", "Service ABC Failed");
        splunkEvent.addPair("ERRORDESC", "BusinessException: Username and password don't match");
        splunkEvent.addPair(SplunkEvent.COMMON_START_TIME, "Thu Aug 15 2014 00:15:06");

        exchange.getIn().setBody(splunkEvent, SplunkEvent.class);
    }
View Full Code Here

    public void process(Exchange exchange) throws Exception {
        SplunkEvent splunkEvent = new SplunkEvent();

        splunkEvent.addPair("ERRORKEY", "AVUA123");
        splunkEvent.addPair("ERRORMSG", "Service ABC Failed");
        splunkEvent.addPair("ERRORDESC", "BusinessException: Username and password don't match");
        splunkEvent.addPair(SplunkEvent.COMMON_START_TIME, "Thu Aug 15 2014 00:15:06");

        exchange.getIn().setBody(splunkEvent, SplunkEvent.class);
    }
}
View Full Code Here

        SplunkEvent splunkEvent = new SplunkEvent();

        splunkEvent.addPair("ERRORKEY", "AVUA123");
        splunkEvent.addPair("ERRORMSG", "Service ABC Failed");
        splunkEvent.addPair("ERRORDESC", "BusinessException: Username and password don't match");
        splunkEvent.addPair(SplunkEvent.COMMON_START_TIME, "Thu Aug 15 2014 00:15:06");

        exchange.getIn().setBody(splunkEvent, SplunkEvent.class);
    }
}
View Full Code Here

    protected static final String INDEX = "junit";

    @Before
    public void init() throws Exception {
        SplunkEvent splunkEvent = new SplunkEvent();
        splunkEvent.addPair("key1", "value1");
        splunkEvent.addPair("key2", "value2");
        splunkEvent.addPair("key3", "value3");
        template.sendBody("direct:submit", splunkEvent);
    }
View Full Code Here

    @Before
    public void init() throws Exception {
        SplunkEvent splunkEvent = new SplunkEvent();
        splunkEvent.addPair("key1", "value1");
        splunkEvent.addPair("key2", "value2");
        splunkEvent.addPair("key3", "value3");
        template.sendBody("direct:submit", splunkEvent);
    }

}
View Full Code Here

    @Test
    public void testEventDataWithQuotedValues() {
        Date now = new Date();
        SplunkEvent event = new SplunkEvent("testevent", "123", false, true);
        event.addPair("key1", "value1");
        event.addPair("key2", "value2 with whitespace");
        event.addPair(SplunkEvent.COMMON_DVC_TIME, now);
        assertEquals("Values should be quoted", "name=\"testevent\" event_id=\"123\" key1=\"value1\" key2=\"value2 with whitespace\" dvc_time=\"" + now.toString() + "\"\n",
                     event.toString());
        assertEquals(5, event.getEventData().size());
View Full Code Here

    @Test
    public void testEventDataWithQuotedValues() {
        Date now = new Date();
        SplunkEvent event = new SplunkEvent("testevent", "123", false, true);
        event.addPair("key1", "value1");
        event.addPair("key2", "value2 with whitespace");
        event.addPair(SplunkEvent.COMMON_DVC_TIME, now);
        assertEquals("Values should be quoted", "name=\"testevent\" event_id=\"123\" key1=\"value1\" key2=\"value2 with whitespace\" dvc_time=\"" + now.toString() + "\"\n",
                     event.toString());
        assertEquals(5, event.getEventData().size());
        assertTrue(event.getEventData().get("key2").equals("value2 with whitespace"));
View Full Code Here

    @Before
    public void init() throws Exception {
        SplunkEvent splunkEvent = new SplunkEvent();
        splunkEvent.addPair("key1", "value1");
        splunkEvent.addPair("key2", "value2");
        splunkEvent.addPair("key3", "value3");
        template.sendBody("direct:submit", splunkEvent);
    }

}
View Full Code Here

    public void testEventDataWithQuotedValues() {
        Date now = new Date();
        SplunkEvent event = new SplunkEvent("testevent", "123", false, true);
        event.addPair("key1", "value1");
        event.addPair("key2", "value2 with whitespace");
        event.addPair(SplunkEvent.COMMON_DVC_TIME, now);
        assertEquals("Values should be quoted", "name=\"testevent\" event_id=\"123\" key1=\"value1\" key2=\"value2 with whitespace\" dvc_time=\"" + now.toString() + "\"\n",
                     event.toString());
        assertEquals(5, event.getEventData().size());
        assertTrue(event.getEventData().get("key2").equals("value2 with whitespace"));
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.