<?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: bin by date that is not the time field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/bin-by-date-that-is-not-the-time-field/m-p/552456#M156812</link>
    <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;strptime&lt;/FONT&gt; function is pretty easy to work with (but I also think regex is easy&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup file.csv
| eval datetime=strptime(foo, "%m/%d/%Y")
| bin span=1d datetime
| stats count by datetime
```Make the datetime field human-readable```
| fieldformat datetime=strftime(datetime, "%m/%d/%Y")&lt;/LI-CODE&gt;&lt;P&gt;See the Search Reference manual for detail about &lt;FONT face="courier new,courier"&gt;strptime&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;strftime&lt;/FONT&gt;, and their format strings.&lt;/P&gt;</description>
    <pubDate>Thu, 20 May 2021 20:36:00 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-05-20T20:36:00Z</dc:date>
    <item>
      <title>bin by date that is not the time field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/bin-by-date-that-is-not-the-time-field/m-p/552444#M156804</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;So I have a goal to count user visits, but the log polls too frequently, so we are going to define a visit by one user per day. In this instance the data is not yet in splunk, but on an excel spreadsheet. I'm not very good with excel, so I want to add to splunk and use the bin feature.&lt;/P&gt;&lt;P&gt;I have userid and date. I can use either the time field or the date field and I can reformat the date field, but currently the datefield is mm/d/yyyy. I can reformt if makes it easier.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I have my lookup, how do I use the equivalent bin _time span=1d where the time is now a date field?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 18:42:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/bin-by-date-that-is-not-the-time-field/m-p/552444#M156804</guid>
      <dc:creator>user93</dc:creator>
      <dc:date>2021-05-20T18:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: bin by date that is not the time field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/bin-by-date-that-is-not-the-time-field/m-p/552448#M156807</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;bin&lt;/FONT&gt; command takes a field of your choosing.&amp;nbsp; Replace _time with the name of your datetime field.&amp;nbsp; For best results, convert the field into epoch form using &lt;FONT face="courier new,courier"&gt;strptime&lt;/FONT&gt; before using &lt;FONT face="courier new,courier"&gt;bin&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 18:52:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/bin-by-date-that-is-not-the-time-field/m-p/552448#M156807</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-05-20T18:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: bin by date that is not the time field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/bin-by-date-that-is-not-the-time-field/m-p/552449#M156808</link>
      <description>&lt;P&gt;Thanks Rich! I've only used strptime once, I'm now trying to learn how to strip time M/D/Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;|inputlookup file.csv&lt;/P&gt;&lt;P&gt;|strptime&lt;/P&gt;&lt;P&gt;|bin&lt;/P&gt;&lt;P&gt;|stats count&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 19:02:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/bin-by-date-that-is-not-the-time-field/m-p/552449#M156808</guid>
      <dc:creator>user93</dc:creator>
      <dc:date>2021-05-20T19:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: bin by date that is not the time field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/bin-by-date-that-is-not-the-time-field/m-p/552456#M156812</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;strptime&lt;/FONT&gt; function is pretty easy to work with (but I also think regex is easy&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup file.csv
| eval datetime=strptime(foo, "%m/%d/%Y")
| bin span=1d datetime
| stats count by datetime
```Make the datetime field human-readable```
| fieldformat datetime=strftime(datetime, "%m/%d/%Y")&lt;/LI-CODE&gt;&lt;P&gt;See the Search Reference manual for detail about &lt;FONT face="courier new,courier"&gt;strptime&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;strftime&lt;/FONT&gt;, and their format strings.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 20:36:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/bin-by-date-that-is-not-the-time-field/m-p/552456#M156812</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-05-20T20:36:00Z</dc:date>
    </item>
  </channel>
</rss>

