I installed packetbeat on a server and have it publish event data to elasticsearch version 8.5 and kibana version 8.5. It seems to be working. I set up a simple Rest API on the server with packetbeat and made a few http requests to the Rest API to see if packetbeat will capture the packet data.
The API works fine and I can see that packetbeat is detecting traffic to the rest api on destination.port: 80 as shown by this image:
However, the query network.protocol: http returns nothing. Why does network.protocol: http return nothing? Many of the dashboards/visualizations depend on the query network.protocol: http.
First I suspect are you running packetbeat and the webserver and your client all the the same server...
The most important is the client and the webserver on the same server..
I tested all this with the following on a Mac with Elastic Stack in including packetbeat 8.5.3
Here is the issue I believe ... and I tested and saw the same behavior.
If you are testing the HTTP traffic between a client and the http server on port 80 on the same server the traffic never actually goes through the interface that packetbeat is monitoring because the OS is smart enough to know the traffic is "Loop Back" or 127.0.0.1 so the HTTP traffic will not show up ... the http traffic will only be monitored IF it actually passes through the interface being monitored.
So in order to test...
you can test by setting the device to loopback
packetbeat.interfaces.device: lo0
And now I hit my local Kibana which is http Traffic on 5601 and I see the http Traffic... in fact I also see the packebeat talking HTTP to elasticsearch.
packetbeat and the web server on the same server in Australia with IP address 194.195.120.250
i have a computer in my office in North America. Let's say my office has a public IPv4 address is 1.1.1.1. The computer uses promox hypervisor to spin up elastic server on a local ip address of 192.168.0.33 and kibana server on a local ip address of 192.168.0.34
I have another computer in my office 1.1.1.1 using Windows and Firefox with local ip address of 192.168.0.10, which I use as my client to ping the http://194.195.120.250 url
I tried changing packetbeat.interfaces.device: eth0 to use eth0 in my /etc/packetbeat/packetbeat.yml. I then systemctl restart packetbeat
Doing a query for destination.port: 80 did yield results like this:
Confirmed!!!! This was not an issue with packetbeat! It had something to do with my router/dhcp server/port forwarding/traffic forwarding or something else in my office network.
I tried spinning up a new VM in my office with 192.168.0.35 and put packetbeat and a webserver on it. When I ping my web server from 192.168.0.10 with my Firefox browser, the kibana query network.protocol: http now shows results.
I lost so much time on this, but your answer pointed me in the right direction, thank you!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.