<?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: Is dynamic query construction possble in Splunk without using any SDKs ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117331#M31257</link>
    <description>&lt;P&gt;How do you identify "the particular batch of records" to process? Is it just events from the last hour or is that variable each hour? Are you processing multiple batches each hour? By "batch query logic should be modified dynamically" What determines the dynamics of this query? Something in how the search is launched? Something in the data of the batch? Something else?&lt;/P&gt;

&lt;P&gt;Another potential thought is a combination of  &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/gentimes"&gt;gentimes&lt;/A&gt; and &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/map"&gt;map&lt;/A&gt; but without understanding what your goal is and what the data looks like it's still just a guess in the dark.&lt;/P&gt;</description>
    <pubDate>Sat, 23 May 2015 22:10:46 GMT</pubDate>
    <dc:creator>acharlieh</dc:creator>
    <dc:date>2015-05-23T22:10:46Z</dc:date>
    <item>
      <title>Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117326#M31252</link>
      <description>&lt;P&gt;I need to modify the query of saved search based on some conditions. Is it possible using only Splunk query language?&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2015 04:09:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117326#M31252</guid>
      <dc:creator>Arun_N_007</dc:creator>
      <dc:date>2015-05-22T04:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117327#M31253</link>
      <description>&lt;P&gt;Based on what sort of conditions and what sort of modifications do you need to make? Query replacement tokens and subsearches might be helpful here but a complete answer requires more detail as to what you have and are trying to accomplish. The docs on &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Savedsearch"&gt;savedsearch&lt;/A&gt; gives a hint at using string substitution for replacement tokens&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2015 04:30:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117327#M31253</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-05-22T04:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117328#M31254</link>
      <description>&lt;P&gt;For Example,&lt;/P&gt;

&lt;P&gt;I want to have a single saved search query which will get executed for every 1hr and it will be processing the particular batch of records. &lt;BR /&gt;
And for each batch query logic should be modifed dynamically.&lt;/P&gt;

&lt;P&gt;Can we accomplish this using custom command? Can we invoke another query inside custom command without using Splunk Python SDK?&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2015 04:39:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117328#M31254</guid>
      <dc:creator>Arun_N_007</dc:creator>
      <dc:date>2015-05-22T04:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117329#M31255</link>
      <description>&lt;P&gt;I think what you may need is a &lt;CODE&gt;macro&lt;/CODE&gt;:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/macrosconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/macrosconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2015 02:55:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117329#M31255</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-23T02:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117330#M31256</link>
      <description>&lt;P&gt;Hmm I tried that you cant return a macro name with parameters using return statement.&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2015 19:22:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117330#M31256</guid>
      <dc:creator>Arun_N_007</dc:creator>
      <dc:date>2015-05-23T19:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117331#M31257</link>
      <description>&lt;P&gt;How do you identify "the particular batch of records" to process? Is it just events from the last hour or is that variable each hour? Are you processing multiple batches each hour? By "batch query logic should be modified dynamically" What determines the dynamics of this query? Something in how the search is launched? Something in the data of the batch? Something else?&lt;/P&gt;

&lt;P&gt;Another potential thought is a combination of  &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/gentimes"&gt;gentimes&lt;/A&gt; and &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/map"&gt;map&lt;/A&gt; but without understanding what your goal is and what the data looks like it's still just a guess in the dark.&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2015 22:10:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117331#M31257</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-05-23T22:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117332#M31258</link>
      <description>&lt;P&gt;What I meant was that maybe you could abandon your current approach and start over using a &lt;CODE&gt;macro&lt;/CODE&gt;-based approach.&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2015 01:03:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117332#M31258</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-24T01:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117333#M31259</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Use case is like,&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;I need to calculate the average completion time of Jobs.&lt;/LI&gt;
&lt;LI&gt;Period is configurable.&lt;/LI&gt;
&lt;LI&gt;I have list of Jobs in Lookup for which i need to caluclate averages.&lt;/LI&gt;
&lt;LI&gt;In that list i have different type of Jobs for which calculation Logic (Due to time format and all...) differs.&lt;/LI&gt;
&lt;LI&gt;Since Splunk got limit on transformation commands like stats,eventstats(50K) i need to make sure that scaling should be done based on limit.&lt;/LI&gt;
&lt;LI&gt;I should be able to design buckets dynamically using queries. And Average query should run for each buckets without any manual intervention.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 25 May 2015 06:05:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117333#M31259</guid>
      <dc:creator>Arun_N_007</dc:creator>
      <dc:date>2015-05-25T06:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117334#M31260</link>
      <description>&lt;P&gt;This is crazy but you could use the &lt;CODE&gt;ouputlookup&lt;/CODE&gt; command to use the &lt;CODE&gt;KV store&lt;/CODE&gt; as a registry of sorts like this:&lt;/P&gt;

&lt;P&gt;Write your initial lookup :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* | eval HardCodedKey= 0 | stats first(HardCodedKey) AS HardCodedKey BY host | dedup HardCodedKey | eval NextSearchString="Your Inital or Default Search Here" | stats count by HardCodedKey, NextSearchString| outputlookup MyLookup
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then your scheduled search could do something like this (and also something like above, to refresh the registry for the next run):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* | eval HardCodedKey= 0 | stats first(HardCodedKey) AS HardCodedKey BY host | dedup HardCodedKey | lookup MyLookup HardCodedKey OUTPUT NextSearchString | map search="Some Search Stuff $NextSearchString$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 May 2015 13:41:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117334#M31260</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-25T13:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117335#M31261</link>
      <description>&lt;P&gt;Thank you woodcock,&lt;BR /&gt;
For showing unknown approach &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;But still map got limit of 10K (due to Sub Search limit) :)..&lt;/P&gt;

&lt;P&gt;I know that if am using SDKs I can accomplish inside commands but I don't have SDK.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2015 11:36:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117335#M31261</guid>
      <dc:creator>Arun_N_007</dc:creator>
      <dc:date>2015-05-26T11:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is dynamic query construction possble in Splunk without using any SDKs ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117336#M31262</link>
      <description>&lt;P&gt;Hi Woodcock,&lt;/P&gt;

&lt;P&gt;Any other way to achieve this use case other than using map..&lt;/P&gt;

&lt;P&gt;Any equivalent to map without 10K limit???&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2015 03:39:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-dynamic-query-construction-possble-in-Splunk-without-using/m-p/117336#M31262</guid>
      <dc:creator>Arun_N_007</dc:creator>
      <dc:date>2015-05-27T03:39:40Z</dc:date>
    </item>
  </channel>
</rss>

