<?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: auto increment on query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433785#M123830</link>
    <description>&lt;P&gt;i add the count ,and then the counter ,i still have a prolem with sorting &lt;/P&gt;

&lt;P&gt;Comm 11:...&lt;BR /&gt;
Comm 1:...&lt;BR /&gt;
Comm 15:...&lt;BR /&gt;
I used aldo sort desc and asc ,but doesnt work too&lt;/P&gt;</description>
    <pubDate>Fri, 01 Jun 2018 13:46:24 GMT</pubDate>
    <dc:creator>taha13</dc:creator>
    <dc:date>2018-06-01T13:46:24Z</dc:date>
    <item>
      <title>auto increment on query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433783#M123828</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'am writing a query to retrieve comments of my clients&lt;BR /&gt;
This is my query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval q_commentaireSupplementaire= "Comm:".q_commentaireSupplementaire
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my result :&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5110i553BDAFD7392A9B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;What i want is to have an auto increment =&amp;gt; &lt;/P&gt;

&lt;P&gt;Comm 1:**** de *** est un personne fortement recommandable et serviable.** ****.&lt;BR /&gt;
Comm 2:C'est très pratique , surtout quand on ne peut pas joindre notre conseiller dans l'agence&lt;BR /&gt;
Comm 3:C'est une très bonne initiative, ce qui permet d'avoir rapidement une réponse. Je suis satisfait&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 10:45:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433783#M123828</guid>
      <dc:creator>taha13</dc:creator>
      <dc:date>2018-06-01T10:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: auto increment on query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433784#M123829</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | streamstats count as row |  eval q_commentaireSupplementaire= "Comm " . row . ":" . q_commentaireSupplementaire
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jun 2018 13:32:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433784#M123829</guid>
      <dc:creator>kmorris_splunk</dc:creator>
      <dc:date>2018-06-01T13:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: auto increment on query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433785#M123830</link>
      <description>&lt;P&gt;i add the count ,and then the counter ,i still have a prolem with sorting &lt;/P&gt;

&lt;P&gt;Comm 11:...&lt;BR /&gt;
Comm 1:...&lt;BR /&gt;
Comm 15:...&lt;BR /&gt;
I used aldo sort desc and asc ,but doesnt work too&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 13:46:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433785#M123830</guid>
      <dc:creator>taha13</dc:creator>
      <dc:date>2018-06-01T13:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: auto increment on query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433786#M123831</link>
      <description>&lt;P&gt;@taha13, add &lt;CODE&gt;printf()&lt;/CODE&gt; function after streamstats to pad zeros to row count values as sorting is considering the Column as string. The following pads upto three zeros i.e. can sort up to 999 comments.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  streamstats count as row 
|  eval sno=printf("%03d",row)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also make sure that the field is not multivalue rather it is single value. You can share your current query if this does not help.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 14:08:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433786#M123831</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-06-01T14:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: auto increment on query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433787#M123832</link>
      <description>&lt;P&gt;@niketnilay &lt;BR /&gt;
Error in 'eval' command: The 'printf' function is unsupported or undefined.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 14:24:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433787#M123832</guid>
      <dc:creator>taha13</dc:creator>
      <dc:date>2018-06-01T14:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: auto increment on query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433788#M123833</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;        | streamstats count as row
        | eval sno =printf("%03d",row)
        | eval q_commentaireSupplementaire= "Comm ".sno.": ".q_commentaireSupplementaire
        | stats VALUES(q_commentaireSupplementaire) AS Commentaire BY qa_noteSatisfaction 
        | sort qa_noteSatisfaction desc
        | rename qa_noteSatisfaction AS Note_Satisfaction
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jun 2018 14:36:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433788#M123833</guid>
      <dc:creator>taha13</dc:creator>
      <dc:date>2018-06-01T14:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: auto increment on query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433789#M123834</link>
      <description>&lt;P&gt;@taha, which version of Splunk are you on?&lt;/P&gt;

&lt;P&gt;instead of &lt;CODE&gt;printf()&lt;/CODE&gt; use the following eval with &lt;CODE&gt;case()&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  eval sno=case(len(sno)=1,"00".sno,len(sno)=2,"0".sno,true(),sno)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, just to be sure of what your data looks like, I was interested in transforming command before &lt;CODE&gt;streamstats&lt;/CODE&gt;, that you have posted. Post that piece of search if above eval with &lt;CODE&gt;case()&lt;/CODE&gt; does not work.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 14:52:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/auto-increment-on-query/m-p/433789#M123834</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-06-01T14:52:59Z</dc:date>
    </item>
  </channel>
</rss>

