Examples of addPair()


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

    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

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

        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

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

    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

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

    @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

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

    @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

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

    @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

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

    @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

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

    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

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

    @Test
    public void testStreamWriter() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:stream-result");
        mock.setExpectedMessageCount(1);
        SplunkEvent splunkEvent = new SplunkEvent();
        splunkEvent.addPair("key11", "value1");
        splunkEvent.addPair("key22", "value2");
        splunkEvent.addPair("key33", "value3");
        template.sendBody("direct:stream", splunkEvent);
        assertMockEndpointsSatisfied();
        Producer streamProducer = streamEndpoint.createProducer();
View Full Code Here

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

    public void testStreamWriter() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:stream-result");
        mock.setExpectedMessageCount(1);
        SplunkEvent splunkEvent = new SplunkEvent();
        splunkEvent.addPair("key11", "value1");
        splunkEvent.addPair("key22", "value2");
        splunkEvent.addPair("key33", "value3");
        template.sendBody("direct:stream", splunkEvent);
        assertMockEndpointsSatisfied();
        Producer streamProducer = streamEndpoint.createProducer();
        assertIsInstanceOf(StreamDataWriter.class, ((SplunkProducer) streamProducer).getDataWriter());
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.