Package org.elasticsearch.common.xcontent

Examples of org.elasticsearch.common.xcontent.XContentBuilder.field()


            expected.field("@source_host", "test@localhost");
            expected.field("@source_path", "/tmp/test");

            expected.startObject("@fields");
                expected.field("timestamp", String.valueOf(timestamp));
                expected.field("src_path", "/tmp/test");
                expected.field("host", "test@localhost");
                expected.field("headerNameTwo", "headerValueTwo");
                expected.field("source", "flume_tail_src");
                expected.field("headerNameOne", "headerValueOne");
                expected.field("type", "sometype");
View Full Code Here


            expected.field("@source_path", "/tmp/test");

            expected.startObject("@fields");
                expected.field("timestamp", String.valueOf(timestamp));
                expected.field("src_path", "/tmp/test");
                expected.field("host", "test@localhost");
                expected.field("headerNameTwo", "headerValueTwo");
                expected.field("source", "flume_tail_src");
                expected.field("headerNameOne", "headerValueOne");
                expected.field("type", "sometype");
            expected.endObject();
View Full Code Here

            expected.startObject("@fields");
                expected.field("timestamp", String.valueOf(timestamp));
                expected.field("src_path", "/tmp/test");
                expected.field("host", "test@localhost");
                expected.field("headerNameTwo", "headerValueTwo");
                expected.field("source", "flume_tail_src");
                expected.field("headerNameOne", "headerValueOne");
                expected.field("type", "sometype");
            expected.endObject();
View Full Code Here

            expected.startObject("@fields");
                expected.field("timestamp", String.valueOf(timestamp));
                expected.field("src_path", "/tmp/test");
                expected.field("host", "test@localhost");
                expected.field("headerNameTwo", "headerValueTwo");
                expected.field("source", "flume_tail_src");
                expected.field("headerNameOne", "headerValueOne");
                expected.field("type", "sometype");
            expected.endObject();

        expected.endObject();
View Full Code Here

                expected.field("timestamp", String.valueOf(timestamp));
                expected.field("src_path", "/tmp/test");
                expected.field("host", "test@localhost");
                expected.field("headerNameTwo", "headerValueTwo");
                expected.field("source", "flume_tail_src");
                expected.field("headerNameOne", "headerValueOne");
                expected.field("type", "sometype");
            expected.endObject();

        expected.endObject();
View Full Code Here

                expected.field("src_path", "/tmp/test");
                expected.field("host", "test@localhost");
                expected.field("headerNameTwo", "headerValueTwo");
                expected.field("source", "flume_tail_src");
                expected.field("headerNameOne", "headerValueOne");
                expected.field("type", "sometype");
            expected.endObject();

        expected.endObject();

    XContentBuilder actual = fixture.getContentBuilder(event);
View Full Code Here

    headers.put("headerNameThree", "headerValueThree");
    Event event = EventBuilder.withBody(message.getBytes(charset));
    event.setHeaders(headers);

    XContentBuilder expected = jsonBuilder().startObject();
    expected.field("body", new String(message.getBytes(), charset));
    for (String headerName : headers.keySet()) {
      expected.field(headerName, new String(headers.get(headerName).getBytes(),
          charset));
    }
    expected.endObject();
View Full Code Here

    event.setHeaders(headers);

    XContentBuilder expected = jsonBuilder().startObject();
    expected.field("body", new String(message.getBytes(), charset));
    for (String headerName : headers.keySet()) {
      expected.field(headerName, new String(headers.get(headerName).getBytes(),
          charset));
    }
    expected.endObject();

    XContentBuilder actual = fixture.getContentBuilder(event);
View Full Code Here

            if (logger.isTraceEnabled()) {
                logger.trace("page {} : {}", page.getID(), page.getTitle());
            }
            try {
                XContentBuilder builder = XContentFactory.jsonBuilder().startObject();
                builder.field("title", title);
                builder.field("text", page.getText());
                builder.field("redirect", page.isRedirect());
                builder.field("redirect_page", page.getRedirectPage());
                builder.field("special", page.isSpecialPage());
                builder.field("stub", page.isStub());
View Full Code Here

                logger.trace("page {} : {}", page.getID(), page.getTitle());
            }
            try {
                XContentBuilder builder = XContentFactory.jsonBuilder().startObject();
                builder.field("title", title);
                builder.field("text", page.getText());
                builder.field("redirect", page.isRedirect());
                builder.field("redirect_page", page.getRedirectPage());
                builder.field("special", page.isSpecialPage());
                builder.field("stub", page.isStub());
                builder.field("disambiguation", page.isDisambiguationPage());
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.