<?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: How to run different timerange in subsearch versus the original search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268538#M80774</link>
    <description>&lt;P&gt;you could try this: index=index_cbo (CNPJ="12018955000155" OR CNPJ_WS="12018955000155")&lt;/P&gt;

&lt;P&gt;but I didn't really understand why you need a subsearch... maybe it would help if you pastebin a small sample of your data and give us a preview of the table you expect to see after your query&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 10:54:33 GMT</pubDate>
    <dc:creator>PPape</dc:creator>
    <dc:date>2020-09-29T10:54:33Z</dc:date>
    <item>
      <title>How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268533#M80769</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to execute this query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index_cbo  [search index=index_cbo 12018955000155 "An error ocurred during \"Conexão com servidores\" initialization step."| dedup CNPJ| table CNPJ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;12018955000155 is my ID.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Basically I would like to get all events of this &lt;STRONG&gt;id (12018955000155)&lt;/STRONG&gt; in my &lt;STRONG&gt;index_cbo&lt;/STRONG&gt;. &lt;/P&gt;

&lt;P&gt;The problem is that I just get result up to the time of the last event with the Message "An error ocurred during \"Conexão com servidores\" initialization step.".  To make it clear, I have, for example, 3 events with the correspondent time:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;09:00:00 Message: Hello World
08:59:00 Message: An error ocurred during \"Conexão com servidores\" initialization step
07:40:00 Message: An error ocurred during \"Conexão com servidores\" initialization step
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Instead of I get all the 3 events as a result of my query, I'm just getting the 2 bellows (the one of 8:59:00 and the another of 07:40:00)&lt;BR /&gt;
Anyone can help me? I want to get the 3 events...&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;PS: Just for the matter of testing, the example bellow I've forced my subsearch results in a table of just one id (12018955000155).&lt;/EM&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 10:55:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268533#M80769</guid>
      <dc:creator>rafasalo</dc:creator>
      <dc:date>2016-09-08T10:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268534#M80770</link>
      <description>&lt;P&gt;What do you get when you try this search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index_cbo CNPJ="12018955000155"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Sep 2016 11:11:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268534#M80770</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-08T11:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268535#M80771</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; 09:00:00 Message: Hello World
 08:59:00 Message: An error ocurred during \"Conexão com servidores\" initialization step
 07:40:00 Message: An error ocurred during \"Conexão com servidores\" initialization step
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, when I use the subsearch I just get &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 08:59:00 Message: An error ocurred during \"Conexão com servidores\" initialization step
 07:40:00 Message: An error ocurred during \"Conexão com servidores\" initialization step
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Sep 2016 11:12:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268535#M80771</guid>
      <dc:creator>rafasalo</dc:creator>
      <dc:date>2016-09-08T11:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268536#M80772</link>
      <description>&lt;P&gt;Click on Job&amp;gt;&amp;gt;Inspect Job and in the pop up window, search for litsearch. What is in the final query? You should see something like &lt;CODE&gt;index=index_cbo CNPJ="12018955000155"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 11:21:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268536#M80772</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-08T11:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268537#M80773</link>
      <description>&lt;P&gt;Sorry, I have run my query again. when I search:  index=index_cbo CNPJ="12018955000155" I get:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 08:59:00 Message: An error ocurred during \"Conexão com servidores\" initialization step
 07:40:00 Message: An error ocurred during \"Conexão com servidores\" initialization step
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;BTW the for the Message 09:00:00 Message: Hello World the name of the field is no CNPJ is CNPJ_WS. &lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 11:32:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268537#M80773</guid>
      <dc:creator>rafasalo</dc:creator>
      <dc:date>2016-09-08T11:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268538#M80774</link>
      <description>&lt;P&gt;you could try this: index=index_cbo (CNPJ="12018955000155" OR CNPJ_WS="12018955000155")&lt;/P&gt;

&lt;P&gt;but I didn't really understand why you need a subsearch... maybe it would help if you pastebin a small sample of your data and give us a preview of the table you expect to see after your query&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:54:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268538#M80774</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2020-09-29T10:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268539#M80775</link>
      <description>&lt;P&gt;So it appears your original, subsearch is returning correct results? What is your desired final output?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 12:16:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268539#M80775</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-08T12:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268540#M80776</link>
      <description>&lt;P&gt;I've found the problem:&lt;/P&gt;

&lt;P&gt;Here is the solution:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index_cbo  [search index=index_cbo 12018955000155 "An error ocurred during"| dedup CNPJ|rename CNPJ as CNPJ_WS | table CNPJ_WS]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The field that identifies the message  &lt;STRONG&gt;09:00:00 Message: Hello World&lt;/STRONG&gt; is CNPJ_WS and not just CNPJ.&lt;BR /&gt;
Thank you folks.&lt;/P&gt;

&lt;P&gt;cheers&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 12:55:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268540#M80776</guid>
      <dc:creator>rafasalo</dc:creator>
      <dc:date>2016-09-08T12:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268541#M80777</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I am trying to pass the time from a subsearch to the main search. I used the rename function the way you have mentioned in the above comment, but it is not working. Any idea on what might be the issue? &lt;/P&gt;

&lt;P&gt;This is the subsearch that I am using : &lt;/P&gt;

&lt;P&gt;[|search source=wineventlog:security EventCode=4740 | rename _time as lockout_time | fields user,lockout_time]&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:55:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268541#M80777</guid>
      <dc:creator>mchandrasekaran</dc:creator>
      <dc:date>2020-09-29T10:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268542#M80778</link>
      <description>&lt;P&gt;You don't need a pipe at the start of this subsearch. Once, you fix that your fields user and lockout_time will be passed to main search. I'm assuming your base search has fields user and lockout_time and you want to use this subsearch as filter for those two field values.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:56:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268542#M80778</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T10:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268543#M80779</link>
      <description>&lt;P&gt;Yes, I am using user and lockout_time as a filter. I am able to pass it as _time, the problem arises when I use rename _time as lockout_time&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:55:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268543#M80779</guid>
      <dc:creator>mchandrasekaran</dc:creator>
      <dc:date>2020-09-29T10:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268544#M80780</link>
      <description>&lt;P&gt;You need to change the format of lookout_time in your sub-search. _time is in epoch format. To change the format you can use the &lt;CODE&gt;strftime(lookout_time, "%m-%d-%Y")&lt;/CODE&gt; command (use appropriate modifiers)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268544#M80780</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2020-09-29T10:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to run different timerange in subsearch versus the original search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268545#M80781</link>
      <description>&lt;P&gt;Got it. Thank you so much. &lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2016 00:28:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-different-timerange-in-subsearch-versus-the-original/m-p/268545#M80781</guid>
      <dc:creator>mchandrasekaran</dc:creator>
      <dc:date>2016-09-10T00:28:45Z</dc:date>
    </item>
  </channel>
</rss>

