<?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 find source path that contains spaces in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653032#M225648</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/149978"&gt;@sarit_s&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;to help you, it's manadatory a sample of your logs, anyway, you can use the other chars to extract a regex.&lt;/P&gt;&lt;P&gt;So, if you want to extract the folder from this log:&lt;/P&gt;&lt;P&gt;2023-08-02 host1 11.11.11 10.2.34.12 path="C:\Program Files\folder 1\my_file.docx",&lt;/P&gt;&lt;P&gt;you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "path\=\".*\\(?&amp;lt;folder&amp;gt;[^\\]+)\\\w+\.\w+\""&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/i6V2W4/1" target="_blank"&gt;https://regex101.com/r/i6V2W4/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2023 09:34:20 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-08-03T09:34:20Z</dc:date>
    <item>
      <title>How to create regex to find source path that contains spaces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653027#M225647</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have sources that contain white spaces and I wand to count them&lt;/P&gt;
&lt;P&gt;What is the regex to find all the sources with spaces ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 21:03:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653027#M225647</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2023-08-03T21:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: regex to find source path that contains spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653032#M225648</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/149978"&gt;@sarit_s&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;to help you, it's manadatory a sample of your logs, anyway, you can use the other chars to extract a regex.&lt;/P&gt;&lt;P&gt;So, if you want to extract the folder from this log:&lt;/P&gt;&lt;P&gt;2023-08-02 host1 11.11.11 10.2.34.12 path="C:\Program Files\folder 1\my_file.docx",&lt;/P&gt;&lt;P&gt;you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "path\=\".*\\(?&amp;lt;folder&amp;gt;[^\\]+)\\\w+\.\w+\""&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/i6V2W4/1" target="_blank"&gt;https://regex101.com/r/i6V2W4/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 09:34:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653032#M225648</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-08-03T09:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: regex to find source path that contains spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653033#M225649</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Thanks for your reply&lt;/P&gt;&lt;P&gt;this is an example of my path:&lt;/P&gt;&lt;P&gt;C:\Projects\API Managment Logging\Logs\*.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, the regex you attached is invalid &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 09:36:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653033#M225649</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2023-08-03T09:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: regex to find source path that contains spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653040#M225653</link>
      <description>&lt;P&gt;also , maybe I wasn't clear enough&lt;/P&gt;&lt;P&gt;I want to count all the hosts that have sources with spaces&lt;/P&gt;&lt;P&gt;I don't want to extract the folder, I just need to know how many sources with white space I have&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 10:02:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653040#M225653</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2023-08-03T10:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: regex to find source path that contains spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653042#M225654</link>
      <description>&lt;LI-CODE lang="markup"&gt;| regex source="\s"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Aug 2023 10:21:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653042#M225654</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-03T10:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: regex to find source path that contains spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653046#M225655</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/149978"&gt;@sarit_s&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 11:06:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-regex-to-find-source-path-that-contains-spaces/m-p/653046#M225655</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-08-03T11:06:41Z</dc:date>
    </item>
  </channel>
</rss>

