Package org.elasticsearch.common.xcontent

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


   */
  protected XContentBuilder storeDatetimeValueBuildDocument(String spaceKey, String propertyName, Date datetime)
      throws IOException {
    XContentBuilder builder = jsonBuilder().startObject();
    if (spaceKey != null)
      builder.field("spaceKey", spaceKey);
    builder.field("propertyName", propertyName).field(STORE_FIELD_VALUE, DateTimeUtils.formatISODateTime(datetime));
    builder.endObject();
    return builder;
  }

View Full Code Here


  protected XContentBuilder storeDatetimeValueBuildDocument(String spaceKey, String propertyName, Date datetime)
      throws IOException {
    XContentBuilder builder = jsonBuilder().startObject();
    if (spaceKey != null)
      builder.field("spaceKey", spaceKey);
    builder.field("propertyName", propertyName).field(STORE_FIELD_VALUE, DateTimeUtils.formatISODateTime(datetime));
    builder.endObject();
    return builder;
  }

  @Override
View Full Code Here

    expected.field("@type", "sometype");
    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_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");
    expected.endObject();
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();

    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("type", "sometype");
    Event event = EventBuilder.withBody(message.getBytes(charset));
    event.setHeaders(headers);

    XContentBuilder expected = jsonBuilder().startObject();
    expected.field("@message", new String(message.getBytes(), charset));
    expected.field("@timestamp", new Date(timestamp));
    expected.field("@source", "flume_tail_src");
    expected.field("@type", "sometype");
    expected.field("@source_host", "test@localhost");
    expected.field("@source_path", "/tmp/test");
View Full Code Here

    Event event = EventBuilder.withBody(message.getBytes(charset));
    event.setHeaders(headers);

    XContentBuilder expected = jsonBuilder().startObject();
    expected.field("@message", new String(message.getBytes(), charset));
    expected.field("@timestamp", new Date(timestamp));
    expected.field("@source", "flume_tail_src");
    expected.field("@type", "sometype");
    expected.field("@source_host", "test@localhost");
    expected.field("@source_path", "/tmp/test");
    expected.startObject("@fields");
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.