<?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 trim values from results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274210#M82712</link>
    <description>&lt;P&gt;Thanks  for this, but this would work if only one space exists in file name.&lt;/P&gt;

&lt;P&gt;some of filenames has multiple spaces in between as below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;004 3400 date County name age1216.pdf
004 3000 date name.pdf
004 3200 date name
 This was the reason I am looking to do regex from backwards of FileName above,since last 8 spaces are constant for all of the files .
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please help us in doing regex which should check fileName from backwards and needs to exclude 8 spaces and give rest of the value as FileName&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2017 17:19:04 GMT</pubDate>
    <dc:creator>splunker9999</dc:creator>
    <dc:date>2017-02-02T17:19:04Z</dc:date>
    <item>
      <title>How to trim values from results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274208#M82710</link>
      <description>&lt;P&gt;Hi, We are looking to have my file name more readable and that being said FIlename looks like below and need to trim last 8 spaces.&lt;/P&gt;

&lt;P&gt;Below is format my file name looks like and needs to display  as &lt;CODE&gt;data_20130701105312.txt and data_list2&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;data_20130701105312.txt a s o r team_1 ssh 0 *
data_list2 b s o r team_2 ssh 0 *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 15:58:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274208#M82710</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2017-02-02T15:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim values from results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274209#M82711</link>
      <description>&lt;P&gt;Here are two ways and there may be others.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval fname=mvindex(split(Filename," "),0) | ...

... | rex field=Filename "(?&amp;lt;fname&amp;gt;[^\s]*)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Feb 2017 16:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274209#M82711</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-02-02T16:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim values from results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274210#M82712</link>
      <description>&lt;P&gt;Thanks  for this, but this would work if only one space exists in file name.&lt;/P&gt;

&lt;P&gt;some of filenames has multiple spaces in between as below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;004 3400 date County name age1216.pdf
004 3000 date name.pdf
004 3200 date name
 This was the reason I am looking to do regex from backwards of FileName above,since last 8 spaces are constant for all of the files .
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please help us in doing regex which should check fileName from backwards and needs to exclude 8 spaces and give rest of the value as FileName&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 17:19:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274210#M82712</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2017-02-02T17:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim values from results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274211#M82713</link>
      <description>&lt;P&gt;How about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex field=FIlename "(?&amp;lt;Filename&amp;gt;\S+)(\s+\S+){8}$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex field=FIlename "(?&amp;lt;Filename&amp;gt;\w+\.\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Feb 2017 18:52:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274211#M82713</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-02T18:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim values from results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274212#M82714</link>
      <description>&lt;P&gt;@splunker9999 - Did one of the answers below help provide a solution your question? If yes, please click “Accept” below the best answer to resolve this post and upvote anything that was helpful. If no, please leave a comment with more feedback. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2017 23:47:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274212#M82714</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-02-17T23:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim values from results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274213#M82715</link>
      <description>&lt;P&gt;If none of those answers worked for you, then I think we need a clearer explanation.  You say 8 spaces, but I think you may be referring to 8 values after the filename?  If so, then somesoni2's first suggestion should pull the filename correctly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=Filename "(?&amp;lt;Filename&amp;gt;\S+)(\s+\S+){8}$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Feb 2017 00:35:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274213#M82715</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-18T00:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim values from results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274214#M82716</link>
      <description>&lt;P&gt;Your description is confusing to me but if (and that is a HUGE "if") you are asking for a RegEx to consider the flinename as all the first of the non-whitespace-strings separated by spaces (of which there are always 8), then you can use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "^(?&amp;lt;filename&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Mar 2017 21:44:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-values-from-results/m-p/274214#M82716</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-01T21:44:13Z</dc:date>
    </item>
  </channel>
</rss>

