<?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: Search driven by KVStore parameters in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Search-driven-by-KVStore-parameters/m-p/335309#M2873</link>
    <description>&lt;P&gt;@stephendavisWK, if your problem is resolved, please accept the answer.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2017 21:59:28 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2017-11-17T21:59:28Z</dc:date>
    <item>
      <title>Search driven by KVStore parameters</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Search-driven-by-KVStore-parameters/m-p/335306#M2870</link>
      <description>&lt;P&gt;I have a set of events similar to below and a working search for a single ID value of 133. My next step is to make the ID dynamic from a KVStore. My attempts so far have been unsuccessful and I could use some help. I am not even positive this is the right approach. &lt;/P&gt;

&lt;P&gt;This is for a custom app for internal use so options are wide open on how to best approach this.&lt;BR /&gt;
Ideas?&lt;/P&gt;

&lt;P&gt;Events:&lt;BR /&gt;
date time : Process Start for core instance ID: 133&lt;BR /&gt;
date time : random message 1&lt;BR /&gt;
date time : random message 5&lt;BR /&gt;
date time : Process Ending ID: 133&lt;BR /&gt;
date time : Process Start for core instance ID: 145&lt;BR /&gt;
date time : random message 2&lt;BR /&gt;
date time : random message 4&lt;BR /&gt;
date time : random message 7&lt;BR /&gt;
date time : Process Ending ID: 145&lt;BR /&gt;
etc...&lt;/P&gt;

&lt;P&gt;Working search:&lt;BR /&gt;
index=myindex source=mysource&lt;BR /&gt;
[search index=myindex ("Process Start" AND "ID: 133") | head 1 | eval earliest=_time | table earliest] &lt;BR /&gt;
[search index=myindex ("Process Ending" AND "ID: 133") | head 1 | eval latest=_time+1 | table latest] &lt;BR /&gt;
| eval StatusCode=&lt;BR /&gt;
if((like(_raw, "%Process Start%") AND like(_raw, "%ID: 133%")), 1, &lt;BR /&gt;
if(like(_raw, "%Process Ending%"), 2, 0)) &lt;BR /&gt;
| stats sum(StatusCode) as StatusCode, min(_time) as StartTime&lt;BR /&gt;
| eval Started=if((StatusCode /1)&amp;gt;=1,"Success","Fail") &lt;BR /&gt;
| eval Finished=if((StatusCode /2)&amp;gt;=1,"Success","Fail") &lt;BR /&gt;
| eval Time=strftime(StartTime,"%c")&lt;BR /&gt;
| table StartTime, evalVal1, evalVal2&lt;/P&gt;

&lt;P&gt;Desired Results:&lt;BR /&gt;
ID     StartTime  Started     Finished&lt;BR /&gt;
133  datetime   Success     Success&lt;BR /&gt;
145  datetime   Success     Fail&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:45:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Search-driven-by-KVStore-parameters/m-p/335306#M2870</guid>
      <dc:creator>stephendavisWK</dc:creator>
      <dc:date>2020-09-29T15:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Search driven by KVStore parameters</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Search-driven-by-KVStore-parameters/m-p/335307#M2871</link>
      <description>&lt;P&gt;Correction: "| table StartTime, evalVal1, evalVal2" in working search should be "| table StartTime, Started, Finished"&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 14:05:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Search-driven-by-KVStore-parameters/m-p/335307#M2871</guid>
      <dc:creator>stephendavisWK</dc:creator>
      <dc:date>2017-09-15T14:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Search driven by KVStore parameters</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Search-driven-by-KVStore-parameters/m-p/335308#M2872</link>
      <description>&lt;P&gt;The final solution involved writing a python script which pulled data from a kvstore. Then using these parameters performing additional searches to gather events. The events were then accumulated in a json result set and returned to the client.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 19:47:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Search-driven-by-KVStore-parameters/m-p/335308#M2872</guid>
      <dc:creator>stephendavisWK</dc:creator>
      <dc:date>2017-11-17T19:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Search driven by KVStore parameters</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Search-driven-by-KVStore-parameters/m-p/335309#M2873</link>
      <description>&lt;P&gt;@stephendavisWK, if your problem is resolved, please accept the answer.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 21:59:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Search-driven-by-KVStore-parameters/m-p/335309#M2873</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-11-17T21:59:28Z</dc:date>
    </item>
  </channel>
</rss>

