# Use JSON as input for Packetbeat

**URL:** <https://discuss.elastic.co/t/use-json-as-input-for-packetbeat/330763>\
**Category:** Beats\
**Tags:** packetbeat\
**Created:** [April 25, 2023, 6:37pm UTC](https://discuss.elastic.co/t/use-json-as-input-for-packetbeat/330763 "2023-04-25T18:37:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![callamby5](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@callamby5](https://discuss.elastic.co/u/callamby5)\
**Post date:** [April 25, 2023, 6:37pm UTC](https://discuss.elastic.co/t/use-json-as-input-for-packetbeat/330763/1 "2023-04-25T18:37:23Z")

</div>

I am trying to use packetbeat to view a pcap file in Kibana. I have converted my pcap file into json because I know that is the type of file that packetbeat can take in. I used the command:

`C:\Program Files\Packetbeat>.\packetbeat.exe -e -I pcaptestfiles/pcaptest2.json -E packetbeat.interfaces.device=any`

but when I run the command it soon says `Exiting: sniffer loop failed: failed to start sniffer: unknown file format`

Any ideas on how to solve this?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [April 26, 2023, 4:11am UTC](https://discuss.elastic.co/t/use-json-as-input-for-packetbeat/330763/2 "2023-04-26T04:11:09Z")

</div>

> [@callamby5](#):
>
> I have converted my pcap file into json because I know that is the type of file that packetbeat can take in.

From where you got this information? Packetbeat capture packets from your network interface or you can run it using the command line to read a `pcap` file, not a `json` as you can see in the [documentation](https://www.elastic.co/guide/en/beats/packetbeat/current/command-line-options.html#run-command).

> **`-I, --I FILE`**  
> Reads **packet data** from the specified file instead of reading packets from the network. This option is useful only for testing Packetbeat.

---

<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:** [May 24, 2023, 6:11am UTC](https://discuss.elastic.co/t/use-json-as-input-for-packetbeat/330763/3 "2023-05-24T06:11:53Z")

</div>

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