<?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: How to extract filename from fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434065#M123918</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval date="D:\Program Files\X620\ABC\TGF\Files\sss\Nsences_2016_10_10_12_50.csv Complete, status : 226 Transfer complete." 
| rex field=date "\\\Files.*\\\(?P&amp;lt;filename&amp;gt;.+)\s\w+,"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Jun 2019 08:18:15 GMT</pubDate>
    <dc:creator>vinod94</dc:creator>
    <dc:date>2019-06-19T08:18:15Z</dc:date>
    <item>
      <title>How to extract filename from fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434063#M123916</link>
      <description>&lt;P&gt;I am trying to extract a filename &lt;STRONG&gt;Nsences_2016_10_10_12_50.csv&lt;/STRONG&gt; from below field value.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;D:\Program Files\X620\ABC\TGF\Files\sss\Nsences_2016_10_10_12_50.csv Complete, status : 226 Transfer complete." 
| rex field=raw_field "D:\\(.+\\)*(?&amp;lt;filename&amp;gt;.*)\.csv Complete, status : 226 Transfer complete.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am extracting as below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval raw_field="D:\Program Files\X620\ABC\TGF\Files\sss\Nsences_2016_10_10_12_50.csv Complete, status : 226 Transfer complete." 
| rex field=raw_field "D:\\(.+\\)*(?&amp;lt;filename&amp;gt;.*)\.csv Complete, status : 226 Transfer complete." 
| table raw_field filename
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please help me. Thanks in advance.&lt;/P&gt;

&lt;P&gt;Dhirendra&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:00:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434063#M123916</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2020-09-30T01:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract filename from fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434064#M123917</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Please try below regex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourBaseSearch&amp;gt;
| rex field=&amp;lt;yourfield&amp;gt; "\x5c(?&amp;lt;filename&amp;gt;[^\x5c]+\.[^\s]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jun 2019 07:50:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434064#M123917</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-06-19T07:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract filename from fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434065#M123918</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval date="D:\Program Files\X620\ABC\TGF\Files\sss\Nsences_2016_10_10_12_50.csv Complete, status : 226 Transfer complete." 
| rex field=date "\\\Files.*\\\(?P&amp;lt;filename&amp;gt;.+)\s\w+,"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jun 2019 08:18:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434065#M123918</guid>
      <dc:creator>vinod94</dc:creator>
      <dc:date>2019-06-19T08:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract filename from fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434066#M123919</link>
      <description>&lt;P&gt;Thanks @harsmarvania57  for your answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 09:48:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434066#M123919</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2019-06-19T09:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract filename from fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434067#M123920</link>
      <description>&lt;P&gt;Thank you for your answer @vinod94 &lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 09:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434067#M123920</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2019-06-19T09:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract filename from fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434068#M123921</link>
      <description>&lt;P&gt;Welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 11:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-filename-from-fields/m-p/434068#M123921</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-06-19T11:41:03Z</dc:date>
    </item>
  </channel>
</rss>

