<?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: Display time in chart/table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235475#M69914</link>
    <description>&lt;P&gt;... | eval FirstLogin=strftime(FirstLogin, "%m/%d/%Y")&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jun 2016 14:14:49 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-06-30T14:14:49Z</dc:date>
    <item>
      <title>Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235464#M69903</link>
      <description>&lt;P&gt;I'm trying to have a table that displays &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Time | Country | City | Very Short |Short | Long&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;right now I've managed to get it to show everything I need, except the time. &lt;/P&gt;

&lt;P&gt;My query is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats earliest(_time) as first_login latest(_time) as last_login by IP_address User   
| eval term=last_login-first_login   
| eval term=case(term&amp;lt;86400, "Very Short", term&amp;gt;86400 AND term&amp;lt;(86400*7), "Short", term&amp;gt;(86400*7), "Long") 
| chart dc(User) as usercount by IP_address,term
| iplocation IP_address  
| dedup City
| where (isnotnull(Country) AND isnotnull(City) AND NOT Country="United States" AND trim(Country)!="" AND trim(City)!="")
| table Country City "Very Short" Short Long
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried using eval to do a &lt;CODE&gt;first_login=strftime(first_login,"F%")&lt;/CODE&gt; and then aggregate it with &lt;CODE&gt;stats first()&lt;/CODE&gt; but that made it so the term columns didn't display (VS/S/L).&lt;/P&gt;

&lt;P&gt;Any ideas? I've googled for hours and can't seem to come up with much.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 13:02:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235464#M69903</guid>
      <dc:creator>zsizemore</dc:creator>
      <dc:date>2016-06-30T13:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235465#M69904</link>
      <description>&lt;P&gt;Which time are you looking for. There's a _time, first_login &amp;amp; last_login.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235465#M69904</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2020-09-29T10:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235466#M69905</link>
      <description>&lt;P&gt;to be honest i'm not 100% sure. I think the first_login but i tried putting _time as a column in the chart also first_login and didn't get any results.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:05:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235466#M69905</guid>
      <dc:creator>zsizemore</dc:creator>
      <dc:date>2020-09-29T10:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235467#M69906</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats earliest(_time) as first_login latest(_time) as last_login by IP_address User | eval term=last_login-first_login | eval term=case(term&amp;lt;86400, "Very Short", term&amp;gt;86400 AND term&amp;lt;(86400*7), "Short", term&amp;gt;(86400*7), "Long")  | eval ti=first_login."#".IP_address | chart dc(User) as usercount by ti ,term | rex field=ti "(?&amp;lt;FirstLogin&amp;gt;[^#]+)#(?&amp;lt;IP_address&amp;gt;.*)" | iplocation IP_address | dedup City | where (isnotnull(Country) AND isnotnull(City) AND NOT Country="United States" AND trim(Country)!="" AND trim(City)!="") | table Country City "Very Short" Short Long
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jun 2016 13:29:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235467#M69906</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-30T13:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235468#M69907</link>
      <description>&lt;P&gt;is there another field i should be adding to the table? because its just giving me the same results as the query I started with.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 13:36:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235468#M69907</guid>
      <dc:creator>zsizemore</dc:creator>
      <dc:date>2016-06-30T13:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235469#M69908</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Yes, you should add &lt;CODE&gt;FirstLogin&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 13:42:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235469#M69908</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-30T13:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235470#M69909</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats earliest(_time) as first_login latest(_time) as last_login by IP_address User   
| eval term=last_login-first_login   
| eval term=case(term&amp;lt;86400, "Very Short", term&amp;gt;86400 AND term&amp;lt;(86400*7), "Short", term&amp;gt;(86400*7), "Long") 
| eval chartByComboField = IP_address . ":::" . first_login
| chart dc(User) as usercount BY chartByComboField term
| rex field=chartByComboField "(?&amp;lt;IP_address&amp;gt;.*):::(?&amp;lt;Time&amp;gt;.*)" | fields - chartByComboField 
| iplocation IP_address  
| dedup City
| where (isnotnull(Country) AND isnotnull(City) AND NOT Country="United States" AND trim(Country)!="" AND trim(City)!="")
| table Time Country City "Very Short" Short Long
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jun 2016 13:44:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235470#M69909</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-30T13:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235471#M69910</link>
      <description>&lt;P&gt;Thanks it's showing up now. I don't totally understand what format its displayed in... for example it says 1467082744.850 for the time. Is there a way i can convert that to M/D/Y?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:11:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235471#M69910</guid>
      <dc:creator>zsizemore</dc:creator>
      <dc:date>2016-06-30T14:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235472#M69911</link>
      <description>&lt;P&gt;Thanks it's showing up now. I don't totally understand what format its displayed in... for example it says 1467082744.850 for the time. Is there a way i can convert that to M/D/Y?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:11:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235472#M69911</guid>
      <dc:creator>zsizemore</dc:creator>
      <dc:date>2016-06-30T14:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235473#M69912</link>
      <description>&lt;P&gt;Sure, add this to the end&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval FirstLogin=strftime(FirstLogin, "%m/%d/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:14:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235473#M69912</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-30T14:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235474#M69913</link>
      <description>&lt;P&gt;Yes, just add this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | fieldformat Time = strftime(Time, "%m/%d/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or maybe you meant this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | fieldformat Time = strftime(Time, "%m/%d/%Y %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:14:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235474#M69913</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-30T14:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Display time in chart/table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235475#M69914</link>
      <description>&lt;P&gt;... | eval FirstLogin=strftime(FirstLogin, "%m/%d/%Y")&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:14:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-time-in-chart-table/m-p/235475#M69914</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-30T14:14:49Z</dc:date>
    </item>
  </channel>
</rss>

