<?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: Extract field from Filepath in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-Filepath/m-p/554404#M157364</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230217"&gt;@teco_akelly&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you're sure that the beginning and the end of your file path is always the same, you can use a regex like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;C:\\File Transfer\\Relay Files\\8Series_files\\(?&amp;lt;your_field&amp;gt;[^\\]+)\\WB_CWP8_869\\evt\.txt&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/NXHwWz/1" target="_blank"&gt;https://regex101.com/r/NXHwWz/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 04 Jun 2021 06:27:43 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2021-06-04T06:27:43Z</dc:date>
    <item>
      <title>Extract field from Filepath</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-Filepath/m-p/554377#M157357</link>
      <description>&lt;P&gt;I've got a number of files coming from directories similar to this....&lt;/P&gt;&lt;P&gt;C:\File Transfer\Relay Files\8Series_files\WB-CWP\WB_CWP8_869\evt.txt&lt;/P&gt;&lt;P&gt;I'd like to extract the WB_CWP8_869 and create it as a searchable field. The filepath always looks like this.... the section before the field I want varies....&lt;/P&gt;&lt;P&gt;But the beginning (C:\File Transfer\Relay Files\8Series_files\) and the end (evt.txt) is always the same.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 00:49:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-Filepath/m-p/554377#M157357</guid>
      <dc:creator>teco_akelly</dc:creator>
      <dc:date>2021-06-04T00:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field from Filepath</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-Filepath/m-p/554404#M157364</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230217"&gt;@teco_akelly&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you're sure that the beginning and the end of your file path is always the same, you can use a regex like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;C:\\File Transfer\\Relay Files\\8Series_files\\(?&amp;lt;your_field&amp;gt;[^\\]+)\\WB_CWP8_869\\evt\.txt&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/NXHwWz/1" target="_blank"&gt;https://regex101.com/r/NXHwWz/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 06:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-Filepath/m-p/554404#M157364</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-06-04T06:27:43Z</dc:date>
    </item>
  </channel>
</rss>

