Custom Input Mappings JSON : Could not find any matches for the incoming event with JSONPath
<p>I have an event receiver with custom input mapping as my event format was a little different. It has no meta or correlation attributes. 
Example is:</p>

<pre><code>{ "ts":"2016-05-08T08:59:47.363764Z",
  "uid":"CLuCgz3HHzG7LpLwH9",
  "id.orig_h":"172.30.26.119",
  "id.orig_p":51976,
  "id.resp_h":"172.30.26.160",
  "id.resp_p":22,
  "version":2,
  "client":"SSH-2.0-OpenSSH_5.0",
  "server":"SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6",
  "cipher_alg":"arcfour256",
  "mac_alg":"hmac-md5",
  "compression_alg":"none",
  "kex_alg":"diffie-hellman-group-exchange-sha1",
  "host_key_alg":"ssh-rsa",
  "host_key":"8d:df:71:ac:29:1f:67:6f:f3:dd:c3:e5:2e:5f:3e:b4"}
</code></pre>

<p>There is no newline, I have added to make it readable. Accordingly I created an event receiver with a custom input mapping :</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;eventReceiver name="sshlogreceiver" statistics="disable"
trace="disable" xmlns="http://wso2.org/carbon/eventreceiver"&gt;
&lt;from eventAdapterType="http"&gt;
    &lt;property name="transports"&gt;all&lt;/property&gt;
&lt;/from&gt;
&lt;mapping customMapping="enable" type="json"&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.ts"/&gt;
        &lt;to name="ts" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.uid"/&gt;
        &lt;to name="uid" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.id.orig_h"/&gt;
        &lt;to name="id_orig_h" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.id.orig_p"/&gt;
        &lt;to name="id_orig_p" type="int"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.id.resp_h"/&gt;
        &lt;to name="id_resp_h" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.id.resp_p"/&gt;
        &lt;to name="id_resp_p" type="int"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.version"/&gt;
        &lt;to name="version" type="int"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.client"/&gt;
        &lt;to name="client" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.server"/&gt;
        &lt;to name="server" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.cipher_alg"/&gt;
        &lt;to name="cipher_alg" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.mac_alg"/&gt;
        &lt;to name="mac_alg" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.compression_alg"/&gt;
        &lt;to name="compression_alg" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.kex_alg"/&gt;
        &lt;to name="kex_alg" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.host_key_alg"/&gt;
        &lt;to name="host_key_alg" type="string"/&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;from jsonPath="$.host_key"/&gt;
        &lt;to name="host_key" type="string"/&gt;
    &lt;/property&gt;
&lt;/mapping&gt;
&lt;to streamName="SSHInStream" version="1.0.0"/&gt;
&lt;/eventReceiver&gt;
</code></pre>

<p>The sample event of input stream is :</p>

<pre><code>{
"event": {
    "payloadData": {
        "ts": "data5",
        "uid": "data5",
        "id_orig_h": "data1",
        "id_orig_p": 70,
        "id_resp_h": "data3",
        "id_resp_p": 4,
        "version": 50,
        "client": "data1",
        "server": "data2",
        "cipher_alg": "data5",
        "mac_alg": "data3",
        "compression_alg": "data3",
        "kex_alg": "data4",
        "host_key_alg": "data4",
        "host_key": "data4"
    }
}
}
</code></pre>

<p>I dont have <code>event</code> and <code>payload</code> tags in my events as it is a simple log file. When I try to send events, I got an error on console saying :</p>

<p>ERROR     </p>

<pre><code>{org.wso2.carbon.event.receiver.core.internal.type.json.JSONInputMapper} -  Could not find any matches for the incoming event with JSONPath : com.jayway.jsonpath.JsonPath@543abe49 ,hence dropping the event
</code></pre>

<p>Have I done custom input mapping wrong or what else I need to do?</p>