<?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: Truncating results in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25102#M4072</link>
    <description>&lt;P&gt;Just out of curiousity, what command should I use if I only want to have characters (a-z) returned?&lt;/P&gt;</description>
    <pubDate>Fri, 08 Feb 2013 12:07:28 GMT</pubDate>
    <dc:creator>lemikg</dc:creator>
    <dc:date>2013-02-08T12:07:28Z</dc:date>
    <item>
      <title>Truncating results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25097#M4067</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I am looking for a way to truncate the characters of my results.&lt;/P&gt;

&lt;P&gt;I am doing a simple search like &lt;CODE&gt;sourcetype=ps OR sourcetype=top COMMAND | multikv | stats count by COMMAND&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;In the results I have many similar names like watchdog01, watchdog02, watchdog03 and so on.&lt;/P&gt;

&lt;P&gt;Those I want to truncate to -2 characters in order to display only "watchdog"&lt;/P&gt;

&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;

&lt;P&gt;Best regards&lt;BR /&gt;
Mike&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2013 09:39:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25097#M4067</guid>
      <dc:creator>lemikg</dc:creator>
      <dc:date>2013-02-08T09:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Truncating results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25098#M4068</link>
      <description>&lt;P&gt;If you want to keep a number of characters at the start or end of a field you can do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 increment=5m | eval test1 = replace(starthuman, "^.*(..)$", "\\1") | eval test2 = replace(starthuman, "^(..).*$", "\\1")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Feb 2013 10:01:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25098#M4068</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-02-08T10:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Truncating results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25099#M4069</link>
      <description>&lt;P&gt;Hi Martin, thanks for the quick response. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=ps OR sourcetype=top COMMAND | multikv | stats count by COMMAND | gentimes start=-1 increment=5m | eval test1 = replace(starthuman, "^.*(..)$", "\\1") | eval test2 = replace(starthuman, "^(..).*$", "\\1")&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Doesn't seem to work in my search. It says&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Error in 'gentimes' command: This command must be the first command of a search.&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am not familiar with the "gentime-command" but the search reference states that it is useful to generate time range results.&lt;/P&gt;

&lt;P&gt;Is there another approach?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2013 10:53:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25099#M4069</guid>
      <dc:creator>lemikg</dc:creator>
      <dc:date>2013-02-08T10:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Truncating results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25100#M4070</link>
      <description>&lt;P&gt;gentimes just generates sample data for me. Put the entire query into splunk on its own, nothing before it - then understand what it does, and apply to your problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2013 11:01:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25100#M4070</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-02-08T11:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Truncating results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25101#M4071</link>
      <description>&lt;P&gt;i got you now ^^ thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2013 11:30:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25101#M4071</guid>
      <dc:creator>lemikg</dc:creator>
      <dc:date>2013-02-08T11:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Truncating results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25102#M4072</link>
      <description>&lt;P&gt;Just out of curiousity, what command should I use if I only want to have characters (a-z) returned?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2013 12:07:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25102#M4072</guid>
      <dc:creator>lemikg</dc:creator>
      <dc:date>2013-02-08T12:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Truncating results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25103#M4073</link>
      <description>&lt;P&gt;Just change the regular expression, this matches everything not lowercase a-z and replaces it with nothing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 increment=5m | eval test = replace(starthuman, "[^a-z]", "")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Feb 2013 12:32:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncating-results/m-p/25103#M4073</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-02-08T12:32:00Z</dc:date>
    </item>
  </channel>
</rss>

