<?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 can I remove a string from a source name? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-remove-a-string-from-a-source-name/m-p/296463#M56206</link>
    <description>&lt;P&gt;thanks cusello and kamlesh, i will try your suggestions.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2017 18:54:18 GMT</pubDate>
    <dc:creator>navins007</dc:creator>
    <dc:date>2017-11-17T18:54:18Z</dc:date>
    <item>
      <title>How can I remove a string from a source name?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-remove-a-string-from-a-source-name/m-p/296460#M56203</link>
      <description>&lt;P&gt;below is my search&lt;/P&gt;

&lt;P&gt;source=&lt;EM&gt;abc-server&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I want to trim "-server"  &lt;/P&gt;

&lt;P&gt;and I tried this &lt;/P&gt;

&lt;P&gt;| eval source=trim("&lt;EM&gt;abc-server&lt;/EM&gt;", "-server") &lt;/P&gt;

&lt;P&gt;did not work any idea how to do this?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 00:18:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-remove-a-string-from-a-source-name/m-p/296460#M56203</guid>
      <dc:creator>navins007</dc:creator>
      <dc:date>2017-11-17T00:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove a string from a source name?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-remove-a-string-from-a-source-name/m-p/296461#M56204</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Can you please try below search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH | rex field=source "(?&amp;lt;source&amp;gt;.*)\-.*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 08:15:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-remove-a-string-from-a-source-name/m-p/296461#M56204</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-11-17T08:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove a string from a source name?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-remove-a-string-from-a-source-name/m-p/296462#M56205</link>
      <description>&lt;P&gt;Hi navins007,&lt;BR /&gt;
the easiest way is a regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=source "(?&amp;lt;source&amp;gt;[^-]*)-server"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or, if the string before "-server" has a fixed lenght&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval source=substr(source,1,string_lenght)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but regex is better and more efficient!&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 08:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-remove-a-string-from-a-source-name/m-p/296462#M56205</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-11-17T08:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove a string from a source name?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-remove-a-string-from-a-source-name/m-p/296463#M56206</link>
      <description>&lt;P&gt;thanks cusello and kamlesh, i will try your suggestions.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 18:54:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-remove-a-string-from-a-source-name/m-p/296463#M56206</guid>
      <dc:creator>navins007</dc:creator>
      <dc:date>2017-11-17T18:54:18Z</dc:date>
    </item>
  </channel>
</rss>

