$IncludeConfig diag-common.conf

# Note: we must mess up with the template, because we can not
# instruct ES to put further constraints on the data type and
# values. So we require integer and make sure it is none.
template(name="tpl" type="list") {
	 constant(value="{\"")        
        property(name="$!key") constant(value="\":") property(name="$!obj")
      constant(value="}")   
}

module(load="../plugins/omelasticsearch/.libs/omelasticsearch")
module(load="../plugins/imfile/.libs/imfile")
ruleset(name="foo") {
  set $!key = "my_obj";
  set $!obj = $msg;
  action(type="omelasticsearch"
	 template="tpl"
	 searchIndex="rsyslog_testbench"
	 searchType="test-type"
	 bulkmode="on"
	 errorFile="./rsyslog.errorfile"
	 erroronly="on")
}

input(type="imfile" File="./inESData.inputfile"
      Tag="foo"
      StateFile="in_log.state"
      Severity="info"
      ruleset="foo")
