I try to enter a pcap file into elasticsearch. So I first convert the pcap file to json like this:
tshark -T ek -j "http tcp ip" -x -r file.pcap > file.json
Then I want to load it up to elasticsearch like this:
curl -H "Content-Type: application/json" -XPOST 'localhost:9200/_bulk?pretty' --data-binary "@file.json"
But this fails with many errors saying that there are duplicate fields in the json. I read that elasticsearch 6.0 doesn't accept duplicate keys anymore. I checked and my json file does indeep contain many duplicate keys. But I read that
tshark -T ek
is supposed to de-duplicate itself and the option --no-duplicate-keys seems to have gone (my tshark version is 2.2.6).
So how do I get my pcap data into elasticsearch?