<?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: Filter the source-file of logs with &amp;quot;rex&amp;quot; command to produce fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154333#M43413</link>
    <description>&lt;P&gt;That is excellent! It worked like a charm! Thanks to both of you!&lt;/P&gt;

&lt;P&gt;However, one thing occurred. The output has two separated charts rather than one, and thus I can't stack the results.&lt;/P&gt;

&lt;P&gt;Any idea?&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
    <pubDate>Tue, 07 Oct 2014 12:33:15 GMT</pubDate>
    <dc:creator>evang_26</dc:creator>
    <dc:date>2014-10-07T12:33:15Z</dc:date>
    <item>
      <title>Filter the source-file of logs with "rex" command to produce fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154330#M43410</link>
      <description>&lt;P&gt;Hi users,&lt;/P&gt;

&lt;P&gt;I automatically import some log-files to Splunk using a script. The naming convention for those files is somehow arbitrary. &lt;/P&gt;

&lt;P&gt;My aim is to produce a panel depicting the totals of the logs for each file in a stacked manner. Till here we are good.&lt;/P&gt;

&lt;P&gt;The problem is that the log-file names are pretty awkward and long given the fact that they also reveal the complete path as to where they came from. I want to present to the viewer only the most intuitive part of the log-file name.&lt;/P&gt;

&lt;P&gt;Here is what I managed to do but it doesn't work as expected. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=nessus source=*SNMP* earliest=-1mon@mon latest=now signature_id=41028| rex "source.*SNMP public community \((?&amp;lt;area&amp;gt;.*)\)" |chart count(dest_dns) by area
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I assume that the "source" of the file is not appeared within the log itself, maybe. And that's why I can't filter it with &lt;STRONG&gt;&lt;EM&gt;rex&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Are you aware of any other technique that might help me to display only a particular part of the source-name?&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2014 12:05:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154330#M43410</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2014-10-07T12:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the source-file of logs with "rex" command to produce fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154331#M43411</link>
      <description>&lt;P&gt;Try this for rex. Field can be used to pick any available fields which splunk provides on the left hand side and then the rex expression which you write will be applied on that field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=source "*SNMP public community \((?&amp;lt;area&amp;gt;.*)\)""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Oct 2014 12:08:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154331#M43411</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2014-10-07T12:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the source-file of logs with "rex" command to produce fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154332#M43412</link>
      <description>&lt;P&gt;You can have &lt;CODE&gt;rex&lt;/CODE&gt; match against any field you like, including the &lt;CODE&gt;source&lt;/CODE&gt; field. Just use the &lt;CODE&gt;field=&lt;/CODE&gt; parameter to &lt;CODE&gt;rex&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Rex"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Rex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2014 12:10:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154332#M43412</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-10-07T12:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the source-file of logs with "rex" command to produce fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154333#M43413</link>
      <description>&lt;P&gt;That is excellent! It worked like a charm! Thanks to both of you!&lt;/P&gt;

&lt;P&gt;However, one thing occurred. The output has two separated charts rather than one, and thus I can't stack the results.&lt;/P&gt;

&lt;P&gt;Any idea?&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2014 12:33:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154333#M43413</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2014-10-07T12:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the source-file of logs with "rex" command to produce fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154334#M43414</link>
      <description>&lt;P&gt;Okay, sorry, false alarm!&lt;/P&gt;

&lt;P&gt;It was the multi-series mode which I've never played with, and for first time was by default switched on.&lt;/P&gt;

&lt;P&gt;Many thanks to both!&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2014 12:41:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-source-file-of-logs-with-quot-rex-quot-command-to/m-p/154334#M43414</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2014-10-07T12:41:55Z</dc:date>
    </item>
  </channel>
</rss>

