<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Windows netstat in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559344#M66086</link>
    <description>&lt;P&gt;Has anyone ever set up a script to monitor ESTABLISHED sessions for Windows using a netstat command?&lt;BR /&gt;I was looking to copy/modify the&amp;nbsp;&lt;SPAN class="s1"&gt;win_listening_ports.bat script that is part of the Splunk for Windows app but am not having much luck. I want to gather local address:local port and foreign address:foreign port, can anyone help?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;BTW - I am aware of the WinNetMon inbound;outbound monitors that are part of the same Windows app. I don't want to capture all connections, rather see a snapshot at specified intervals, like once hourly.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jul 2021 03:22:14 GMT</pubDate>
    <dc:creator>raysonjoberts</dc:creator>
    <dc:date>2021-07-14T03:22:14Z</dc:date>
    <item>
      <title>Windows netstat</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559344#M66086</link>
      <description>&lt;P&gt;Has anyone ever set up a script to monitor ESTABLISHED sessions for Windows using a netstat command?&lt;BR /&gt;I was looking to copy/modify the&amp;nbsp;&lt;SPAN class="s1"&gt;win_listening_ports.bat script that is part of the Splunk for Windows app but am not having much luck. I want to gather local address:local port and foreign address:foreign port, can anyone help?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;BTW - I am aware of the WinNetMon inbound;outbound monitors that are part of the same Windows app. I don't want to capture all connections, rather see a snapshot at specified intervals, like once hourly.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 03:22:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559344#M66086</guid>
      <dc:creator>raysonjoberts</dc:creator>
      <dc:date>2021-07-14T03:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Windows netstat</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559355#M66087</link>
      <description>&lt;P&gt;The easiest way to handle this is to create a scheduled task to run this once an hour.&amp;nbsp; Then set a filemonitor on your forwarder that will read the file and ingest it into Splunk at some point after the scheduled task.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;netstat -nao| FIND "ESTABLISHED" &amp;gt; myestablishedconn.txt&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for example, set the scheduled task with the above command to run every hour at the top of the hour,&amp;nbsp; Then just to ensure to allow time for latency and such set the splunk configuration to monitor that file for ingestion.&amp;nbsp; &amp;nbsp;I'll let you decide how to handle the file, either delete it (if it exists at the begin of each run, by adding a del &lt;EM&gt;filename&lt;/EM&gt; at the beginning of the scheduled task, otherwise ensure when you create the input that you salt the file).&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deastman_0-1626241174227.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15067i0ABFD448A25551CD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deastman_0-1626241174227.png" alt="deastman_0-1626241174227.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the page from documentation discussing file monitoring in greater detail.&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/Monitorfilesanddirectories" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/Monitorfilesanddirectories&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!&amp;nbsp; &amp;nbsp;Happy Splunking!!&lt;/P&gt;&lt;P&gt;Dustin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 05:43:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559355#M66087</guid>
      <dc:creator>deastman</dc:creator>
      <dc:date>2021-07-14T05:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Windows netstat</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559386#M66088</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236374"&gt;@raysonjoberts&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you explored the possibility to use the&amp;nbsp;perfmon://Network input in Splunk TA Windows?&lt;/P&gt;&lt;P&gt;Maybe can solve your need.&lt;/P&gt;&lt;P&gt;Otherwise you can create a script, containing the netstat command and, without saving output in a txt file, you can launch it by inputs.conf, so the script output will be automatically sent to Splunk.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 09:44:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559386#M66088</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-07-14T09:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Windows netstat</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559471#M66093</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The perfmon for network monitor does not get the data I am looking for, I am really just looking for the outputs of a netstat -nao command for established connections.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As to the second part of your answer, I agree, a script would be what I am looking for here but I do not know how to script this and was wondering if anyone had already done it and could provide some direction. The script (win_listening_ports.bat) that is in the Windows app is 'close' to what I need but I don't know how to modify it to get what I want.&amp;nbsp; I want to filter by ESTABLISHED, instead of LISTENING, but also, I want to see the local address and port as well as the foreign address and port.&amp;nbsp; The listening ports script only looks for the local address and port and calls them dest_ip and dest_port, I don't know how to modify that script to also capture the foreign address/ports.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 17:01:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559471#M66093</guid>
      <dc:creator>raysonjoberts</dc:creator>
      <dc:date>2021-07-14T17:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Windows netstat</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559473#M66094</link>
      <description>&lt;P&gt;Thanks for this, and I assume it would work. However, I am looking to gather this information on thousands of servers and may, at times, want to modify the intervals at which I gather this data on a server-by-server basis.&amp;nbsp; In my mind, the best way to do this is through a script, similar to the listening ports script in the Splunk for Windows App, I just don't know how to modify that script to get what I want.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 17:07:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559473#M66094</guid>
      <dc:creator>raysonjoberts</dc:creator>
      <dc:date>2021-07-14T17:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Windows netstat</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559531#M66100</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236374"&gt;@raysonjoberts&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;using a scipt is very easy in Splunk, you have to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;create a script (e.g. netstat.bat) containing thge command you want to execute with all the options, without redirtecting in a file (e.g. netstat -nao);&lt;/LI&gt;&lt;LI&gt;than you have to put this file in the bin folder of the TA to deploy;&lt;/LI&gt;&lt;LI&gt;than you have to define the following information to insert in the inputs.conf file:&lt;UL&gt;&lt;LI&gt;index: the index to store events,&lt;/LI&gt;&lt;LI&gt;sourcetype: the sourcetype to parse the events,&lt;/LI&gt;&lt;LI&gt;interval: the interval of script execution,&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;than you have to add in the inputs.conf of that TA the following stanza:&lt;UL&gt;&lt;LI&gt;[script://.\bin\netstat.bat]&lt;/LI&gt;&lt;LI&gt;disabled = 0&lt;/LI&gt;&lt;LI&gt;interval = 300&lt;/LI&gt;&lt;LI&gt;sourcetype = win_netstat&lt;/LI&gt;&lt;LI&gt;index = your_index&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;and deploy&amp;nbsp; the TA to the Servers.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In this way you'll have the output of the netstat command in Splunk.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 06:58:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/559531#M66100</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-07-15T06:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Windows netstat</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/560414#M66157</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;, I appreciate the response.&lt;/P&gt;&lt;P&gt;My question was whether or not anyone has made a script like this and if so, if they could share the script. I understand how to deploy it, I was just having a hard time getting the correct syntax in the script itself. Through some trial and error, I was able to figure out the syntax of the script so I am gathering the data I was looking for.&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 01:45:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/560414#M66157</guid>
      <dc:creator>raysonjoberts</dc:creator>
      <dc:date>2021-07-22T01:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Windows netstat</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/560440#M66158</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236374"&gt;@raysonjoberts&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I'm not an expert in scripting, but, for my knowledge, it should be sufficient to put the command with all the needed option in a text file and launch it from inputs.conf as I described.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 06:47:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/560440#M66158</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-07-22T06:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Windows netstat</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/743919#M81791</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236374"&gt;@raysonjoberts&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have the same needs as you, has your problem been resolved? if so can you give me the script&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 04:24:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Windows-netstat/m-p/743919#M81791</guid>
      <dc:creator>fabiyogo1</dc:creator>
      <dc:date>2025-04-10T04:24:34Z</dc:date>
    </item>
  </channel>
</rss>

