<?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: Use variable on bucketing option in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76366#M19303</link>
    <description>&lt;P&gt;Hi Borja!&lt;/P&gt;

&lt;P&gt;Did you ever find an answer to this? I'm struggling with the same issue. Using the value of an eval field inside a command.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2015 09:45:10 GMT</pubDate>
    <dc:creator>mikaelbje</dc:creator>
    <dc:date>2015-09-08T09:45:10Z</dc:date>
    <item>
      <title>Use variable on bucketing option</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76361#M19298</link>
      <description>&lt;P&gt;Is there any way to use a variable on the bucketing start option? It only works if you use an explicit numeric value.&lt;/P&gt;

&lt;P&gt;| eval DemoTime = strptime(FechaIni,"%Y-%m-%d %H:%M:%S.%l") | bin DemoTime span=7d start=&lt;STRONG&gt;1339372800.000000&lt;/STRONG&gt; as weeks&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2012 10:21:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76361#M19298</guid>
      <dc:creator>bfernandez</dc:creator>
      <dc:date>2012-06-15T10:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable on bucketing option</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76362#M19299</link>
      <description>&lt;P&gt;It's expecting an integer there, not a string.  Are you stringifying your variable by double-quoting the value?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2012 14:16:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76362#M19299</guid>
      <dc:creator>Lamar</dc:creator>
      <dc:date>2012-06-15T14:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable on bucketing option</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76363#M19300</link>
      <description>&lt;P&gt;Hi Lamar,&lt;/P&gt;

&lt;P&gt;In this case, I am using another date field converter by strptime where it is assumed that the output is an integer&lt;/P&gt;

&lt;P&gt;| eval Initialtime = strptime(ADate,"%Y-%m-%d %H:%M:%S.%l")  | bin DemoTime span=7d start=Initialtime as weeks&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2012 07:52:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76363#M19300</guid>
      <dc:creator>bfernandez</dc:creator>
      <dc:date>2012-06-18T07:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable on bucketing option</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76364#M19301</link>
      <description>&lt;P&gt;That's not an integer though.  There are integers in that string you're creating, it might look something like this:&lt;/P&gt;

&lt;P&gt;2012-10-10 10:10:10.100&lt;/P&gt;

&lt;P&gt;What you want to feed it is an integer. try using:&lt;/P&gt;

&lt;P&gt;| convert ctime (ADate) as Initialtime ...&lt;/P&gt;

&lt;P&gt;That will be the epoch conversion of that date-time, which will be an integer that the start keyword is expecting.  And if it's already epoch, just pass it over to start.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2012 14:59:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76364#M19301</guid>
      <dc:creator>Lamar</dc:creator>
      <dc:date>2012-06-18T14:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable on bucketing option</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76365#M19302</link>
      <description>&lt;P&gt;Hi Lamar,&lt;/P&gt;

&lt;P&gt;You are right, this option require a numeric value.&lt;/P&gt;

&lt;P&gt;That’s the reason to use strptime that convert our human readable time string to an epoch time&lt;/P&gt;

&lt;P&gt;Example: &lt;/P&gt;

&lt;P&gt;adate = 2012-06-26 00:00:00.000&lt;BR /&gt;
Initialtime = 1340661600.000000 (numeric)&lt;/P&gt;

&lt;P&gt;Additionaly, I tried to forze this Initialtime field to numeric format with | convert num(Initialtime) as InitialtimeNum but the query always return:&lt;/P&gt;

&lt;P&gt;Error in 'bin' command: The value for option start (InitialTime) is invalid.&lt;/P&gt;

&lt;P&gt;Note: Splunk indicates that Convert command is mostly deprecated.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2012 09:05:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76365#M19302</guid>
      <dc:creator>bfernandez</dc:creator>
      <dc:date>2012-06-28T09:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable on bucketing option</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76366#M19303</link>
      <description>&lt;P&gt;Hi Borja!&lt;/P&gt;

&lt;P&gt;Did you ever find an answer to this? I'm struggling with the same issue. Using the value of an eval field inside a command.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2015 09:45:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-variable-on-bucketing-option/m-p/76366#M19303</guid>
      <dc:creator>mikaelbje</dc:creator>
      <dc:date>2015-09-08T09:45:10Z</dc:date>
    </item>
  </channel>
</rss>

