# Pushing pcap json into Kibana using BULK API

**URL:** <https://discuss.elastic.co/t/pushing-pcap-json-into-kibana-using-bulk-api/208856>\
**Category:** Elasticsearch\
**Created:** [November 21, 2019, 10:34am UTC](https://discuss.elastic.co/t/pushing-pcap-json-into-kibana-using-bulk-api/208856 "2019-11-21T10:34:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmal](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@pmal](https://discuss.elastic.co/u/pmal)\
**Post date:** [November 21, 2019, 10:34am UTC](https://discuss.elastic.co/t/pushing-pcap-json-into-kibana-using-bulk-api/208856/1 "2019-11-21T10:34:43Z")

</div>

I am trying to create index, for pcap files.

here is the request in Dev Tools console:  
POST /pcaptest/\_doc  
{"mappings":  
{"pcap\_file":{  
"properties":{  
"dynamic": "false",  
"index" : {"type":"nested"},  
"timestamp":{"type":"date"},  
"layers":{   
"properties":{  
"tcp":{  
"properties":{  
"tcp\_tcp\_srcport":{"type":"integer"},  
"tcp\_tcp\_dstport":{"type":"integer"}  
}}}}}}}}

it works fine without bulk, my curl command is as follows:  
curl -s -H "Content-Type: application/json" -XPOST [http://x.x.x.x:9200/pcaptest/\_doc](http://x.x.x.x:9200/pcaptest/_doc) --data-binary "@page1.json

Can anybody help me with bulk?

1. what will be the curl request? and
2. what will the POST request?  
I want to have doc as I eventually want to send 1 packet per doc.  
I tried  
POST /pcaptest/\_doc/\_bulk  
it's giving me "error": {  
"root\_cause": [  
{  
"type": "json\_e\_o\_f\_exception",  
"reason": "Unexpected end-of-input within/between Object entries\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@38a3acfa; line: 1, column: 25]"  
}  
I searched existing topics , but could not figure out exact format for POST and curl request

For above request my data json was single valid json block :  
{"index":{"\_index":"packets-20191119","\_type":"pcap\_file"},"timestamp":"1574163762676","layers":{"frame":{"frame\_frame\_interface\_id":"0"}}}

but now I want to send packet json data as follows, which is not a valid json:

{"index":{"\_index":"packets-2019-11-21","_type":"pcap\_file"}}  
{"timestamp":"1574330692870","layers":{"frame":{"frame\_frame\_interface\_id":"0","frame\_interface\_id\_frame\_interface\_name":"\Device\NPF_{C3664358-1A0C-4DB0-A6DB-66A9168C645E}"}}}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 19, 2019, 10:34am UTC](https://discuss.elastic.co/t/pushing-pcap-json-into-kibana-using-bulk-api/208856/2 "2019-12-19T10:34:44Z")

</div>

Closed on December 19, 2019, 10:34am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
