# Can I use Packetbeat and the ELK stack for network logs generated by a website button

**URL:** <https://discuss.elastic.co/t/can-i-use-packetbeat-and-the-elk-stack-for-network-logs-generated-by-a-website-button/329489>\
**Category:** Beats\
**Tags:** packetbeat\
**Created:** [April 6, 2023, 7:43am UTC](https://discuss.elastic.co/t/can-i-use-packetbeat-and-the-elk-stack-for-network-logs-generated-by-a-website-button/329489 "2023-04-06T07:43:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jana\_Urmi](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jana\_Urmi](https://discuss.elastic.co/u/Jana_Urmi)\
**Post date:** [April 6, 2023, 7:43am UTC](https://discuss.elastic.co/t/can-i-use-packetbeat-and-the-elk-stack-for-network-logs-generated-by-a-website-button/329489/1 "2023-04-06T07:43:42Z")

</div>

I wrote a Python script to extract the network logs generated by clicking a button on a website using Selenium and store them in a file. I now want to use the ELK stack to visualize the logs.

I'm confused whether Packetbeat will work or is needed for this use case as I cannot figure out where to specify the url of the website, and how to even send my logs that are stored in a file already to Elasticsearch.

All documentation or articles I've viewed are about applications or system logs. I haven't found anything with regard to a web page.

My Python script for reference:

```auto
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import json
import pprint

capabilities = DesiredCapabilities.CHROME
capabilities["goog:loggingPrefs"] = {"performance": "ALL"}

chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])

driver = webdriver.Chrome(desired_capabilities=capabilities, options = chrome_options ,service=ChromeService(ChromeDriverManager().install()))

driver.get("https://www.lambdatest.com/")
title = driver.title
driver.implicitly_wait(100)
submit_button = driver.find_element(By.LINK_TEXT, "Enterprise")
submit_button.click()
logs = driver.get_log("performance")

data = json.dumps(logs)
with open("log_entries.json", "w") as f:
    f.write(data)
f.close()
# driver.quit()

```

---

<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 4, 2023, 7:43am UTC](https://discuss.elastic.co/t/can-i-use-packetbeat-and-the-elk-stack-for-network-logs-generated-by-a-website-button/329489/2 "2023-05-04T07:43:43Z")

</div>

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