<?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 Re: regex to grab .exe files in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-to-grab-exe-files/m-p/107457#M27922</link>
    <description>&lt;P&gt;Assuming you want the bit from after the slash (exclusive) to the .exe (inclusive), try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "/(?&amp;lt;filename&amp;gt;[^/]+?\.exe)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This looks for a slash, then grabs as few non-slashes as possible until the first .exe mention. Note, this would fail if you have entries like &lt;CODE&gt;foo/bar.exefile.something&lt;/CODE&gt; because it would recognize &lt;CODE&gt;bar.exe&lt;/CODE&gt; - if you expect those cases then you can for example include the trailing space in the regular expression after the closing parenthesis.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Apr 2013 15:49:17 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2013-04-26T15:49:17Z</dc:date>
    <item>
      <title>regex to grab .exe files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-grab-exe-files/m-p/107456#M27921</link>
      <description>&lt;P&gt;these are my logs and i need to grab complete .exe filenames:&lt;/P&gt;

&lt;P&gt;1366986567.625 41 94.229.0.20 TCP_DENIED/403 1896 GET &lt;A href="http://193.142.244.17/lxkj3824y896yursilh/5492.exe" target="_blank"&gt;http://193.142.244.17/lxkj3824y896yursilh/5492.exe&lt;/A&gt; &lt;A href="mailto:cindy@demo.com" target="_blank"&gt;cindy@demo.com&lt;/A&gt; NONE/- - BLOCK_WBRS-DefaultGroup-Demo_Clients-NONE-NONE-NONE &lt;NC&gt; - -&lt;/NC&gt;&lt;/P&gt;

&lt;P&gt;1366984129.742 47 27.35.11.11 NONE/503 1890 GET &lt;A href="http://topwinsystemscan.com/install/installpv.exe" target="_blank"&gt;http://topwinsystemscan.com/install/installpv.exe&lt;/A&gt; &lt;A href="mailto:maximus@demo.com" target="_blank"&gt;maximus@demo.com&lt;/A&gt; NONE/topwinsystemscan.com - OTHER-NONE-Demo_Clients-NONE-NONE-DefaultRouting &lt;NC&gt; - -&lt;/NC&gt;&lt;/P&gt;

&lt;P&gt;1366965031.191 8 203.172.197.2 TCP_DENIED/403 1866 GET &lt;A href="http://81.174.66.128/.comete/10.exe" target="_blank"&gt;http://81.174.66.128/.comete/10.exe&lt;/A&gt; &lt;A href="mailto:tom@demo.com" target="_blank"&gt;tom@demo.com&lt;/A&gt; NONE/- - BLOCK_WBRS-DefaultGroup-Demo_Clients-NONE-NONE-NONE &lt;NC&gt; - -&lt;/NC&gt;&lt;/P&gt;

&lt;P&gt;this is my progress so far:&lt;/P&gt;

&lt;P&gt;| rex field=_raw "http://[a-z0-9./]+(?&amp;lt;&lt;EXE&gt;EXE&amp;gt;)[A-Za-z0-9].exe)"&lt;/EXE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:47:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-grab-exe-files/m-p/107456#M27921</guid>
      <dc:creator>splunkingsplun1</dc:creator>
      <dc:date>2020-09-28T13:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: regex to grab .exe files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-grab-exe-files/m-p/107457#M27922</link>
      <description>&lt;P&gt;Assuming you want the bit from after the slash (exclusive) to the .exe (inclusive), try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "/(?&amp;lt;filename&amp;gt;[^/]+?\.exe)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This looks for a slash, then grabs as few non-slashes as possible until the first .exe mention. Note, this would fail if you have entries like &lt;CODE&gt;foo/bar.exefile.something&lt;/CODE&gt; because it would recognize &lt;CODE&gt;bar.exe&lt;/CODE&gt; - if you expect those cases then you can for example include the trailing space in the regular expression after the closing parenthesis.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2013 15:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-grab-exe-files/m-p/107457#M27922</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-04-26T15:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: regex to grab .exe files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-grab-exe-files/m-p/107458#M27923</link>
      <description>&lt;P&gt;You are very close but try this one and see if it works for you:&lt;/P&gt;

&lt;P&gt;... | rex field=_raw  "\s+http://[a-zA-Z0-9./]+\/(?&lt;EXE&gt;[^.]+).exe\s+"&lt;/EXE&gt;&lt;/P&gt;

&lt;P&gt;the lookahead assertion might have been causing problems. I also grabbed everything up to the last slash then the field "exe" is populated with everything that is not a period. Just a different technique but hope this works out for you. &lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2013 15:52:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-grab-exe-files/m-p/107458#M27923</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2013-04-26T15:52:47Z</dc:date>
    </item>
  </channel>
</rss>

