<?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 How to to sort the date so that my graph is coherent? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639001#M221416</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;thank you in advance for your feedback.&lt;/P&gt;
&lt;P&gt;I would like to sort the date so that my graph is coherent, can you please help me?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=t allow_old_summaries=t count from datamodel=Authentication.Authentication where [| inputlookup ****.csv  | eval host=Machine |  table host  ] AND NOT Authentication.src_user="*$" AND NOT Authentication.src_user="unknown" by host,Authentication.src,Authentication.src_user,_time
| eval host=upper(host)
| eval Serveur='Authentication.src'
| eval **** = upper(trim(('Authentication.src_user')))
| eval samaccountname=substr(trim(upper('Authentication.src_user')),1,7)
| eval domaine="****"
| lookup **** samaccountname as samaccountname domaine as domaine
| search email="*"
| eval **** = samaccountname
| table  ****, ****, host, email,ua,cn,_time,cn
| join host type=left  [| inputlookup *****.csv  | eval host=Machine]
| where  Ferme="****" OR  Ferme="****" OR Ferme="*****" OR Ferme="*****" OR Ferme="****"
| stats values(Ferme) as Ferme values(_time) as _time by *****,cn
| eval Date=strptime(_time,"%d/%m/%Y")
| sort Date
| eval Date=strftime(_time,"%d/%m/%Y")
| stats count as "nb. de connexion par jour" by Ferme,Date&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date.PNG" style="width: 169px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24816i934C062221847B39/image-size/large?v=v2&amp;amp;px=999" role="button" title="date.PNG" alt="date.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2023 17:18:49 GMT</pubDate>
    <dc:creator>numeroinconnu12</dc:creator>
    <dc:date>2023-04-07T17:18:49Z</dc:date>
    <item>
      <title>How to to sort the date so that my graph is coherent?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639001#M221416</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;thank you in advance for your feedback.&lt;/P&gt;
&lt;P&gt;I would like to sort the date so that my graph is coherent, can you please help me?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=t allow_old_summaries=t count from datamodel=Authentication.Authentication where [| inputlookup ****.csv  | eval host=Machine |  table host  ] AND NOT Authentication.src_user="*$" AND NOT Authentication.src_user="unknown" by host,Authentication.src,Authentication.src_user,_time
| eval host=upper(host)
| eval Serveur='Authentication.src'
| eval **** = upper(trim(('Authentication.src_user')))
| eval samaccountname=substr(trim(upper('Authentication.src_user')),1,7)
| eval domaine="****"
| lookup **** samaccountname as samaccountname domaine as domaine
| search email="*"
| eval **** = samaccountname
| table  ****, ****, host, email,ua,cn,_time,cn
| join host type=left  [| inputlookup *****.csv  | eval host=Machine]
| where  Ferme="****" OR  Ferme="****" OR Ferme="*****" OR Ferme="*****" OR Ferme="****"
| stats values(Ferme) as Ferme values(_time) as _time by *****,cn
| eval Date=strptime(_time,"%d/%m/%Y")
| sort Date
| eval Date=strftime(_time,"%d/%m/%Y")
| stats count as "nb. de connexion par jour" by Ferme,Date&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date.PNG" style="width: 169px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24816i934C062221847B39/image-size/large?v=v2&amp;amp;px=999" role="button" title="date.PNG" alt="date.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 17:18:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639001#M221416</guid>
      <dc:creator>numeroinconnu12</dc:creator>
      <dc:date>2023-04-07T17:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639018#M221418</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/216298"&gt;@numeroinconnu12&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;to sort a date you have to transform them in epochtime, so, to sort your search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=t allow_old_summaries=t count from datamodel=Authentication.Authentication where [| inputlookup ****.csv  | eval host=Machine |  table host  ] AND NOT Authentication.src_user="*$" AND NOT Authentication.src_user="unknown" by host,Authentication.src,Authentication.src_user,_time
| eval host=upper(host)
| eval Serveur='Authentication.src'
| eval **** = upper(trim(('Authentication.src_user')))
| eval samaccountname=substr(trim(upper('Authentication.src_user')),1,7)
| eval domaine="****"
| lookup **** samaccountname as samaccountname domaine as domaine
| search email="*"
| eval **** = samaccountname
| table  ****, ****, host, email,ua,cn,_time,cn
| join host type=left  [| inputlookup *****.csv  | eval host=Machine]
| where  Ferme="****" OR  Ferme="****" OR Ferme="*****" OR Ferme="*****" OR Ferme="****"
| stats values(Ferme) as Ferme values(_time) as _time by *****,cn
| stats count as "nb. de connexion par jour" by Ferme,Date
| eval epochDate=strptime(Date,"%d/%m/%Y")
| sort epochDate
| fields - epochDate&lt;/LI-CODE&gt;&lt;P&gt;in addition, it's unuseful to sort before a stats command.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 12:30:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639018#M221418</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-04-06T12:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639020#M221420</link>
      <description>&lt;P&gt;You did well to convert the Date field to epoch form before sorting.&amp;nbsp; However, the &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command spoiled that work by re-sorting by the ferme field.&amp;nbsp; Where the ferme field has repeated values, they are sorted lexicographically by Date.&lt;/P&gt;&lt;P&gt;I believe you can resolve the problem by putting the &lt;FONT face="courier new,courier"&gt;strftime&lt;/FONT&gt; call after the final &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 12:54:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639020#M221420</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-04-06T12:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639023#M221422</link>
      <description>&lt;P&gt;it's work, thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 13:42:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639023#M221422</guid>
      <dc:creator>numeroinconnu12</dc:creator>
      <dc:date>2023-04-06T13:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639028#M221423</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/216298"&gt;@numeroinconnu12&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 14:28:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-to-sort-the-date-so-that-my-graph-is-coherent/m-p/639028#M221423</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-04-06T14:28:27Z</dc:date>
    </item>
  </channel>
</rss>

