<?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 use multiple where conditions in a search to match and correlate start and end time fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283494#M85673</link>
    <description>&lt;P&gt;That's right. My plan to match them up is to use the Start and End Dates. So to do this in the code I was thinking I'd need to use the Where function to execute lines of code only for a specific sourcetype and then move on to the next. &lt;/P&gt;</description>
    <pubDate>Wed, 21 Oct 2015 12:56:26 GMT</pubDate>
    <dc:creator>jsven7</dc:creator>
    <dc:date>2015-10-21T12:56:26Z</dc:date>
    <item>
      <title>How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283487#M85666</link>
      <description>&lt;P&gt;Working with the following:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EventStarts.txt&lt;/STRONG&gt;&lt;BR /&gt;
UserID, Start Date, Start Time&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;SpecialEventStarts.txt&lt;/STRONG&gt;&lt;BR /&gt;
UserID, Start Date, Start Time&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EventEnds.txt&lt;/STRONG&gt;&lt;BR /&gt;
UserID, Start Date, End Time&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;SpecialEventEnds.txt&lt;/STRONG&gt;&lt;BR /&gt;
UserID, Start Date, End Time&lt;/P&gt;

&lt;P&gt;I have to match up the starts with the appropriate ends. So far I know how to extract the required data, but I don't know how to do it for the start and end so as to match them up. I believe I have to use a where condition. This is my thinking...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;x = "EventStarts.txt" OR "SpecialEventStarts.txt" OR "EventEnds.txt" OR "SpecialEventEnds.txt"
| where x = EventStarts.txt
| do what I want you to do
| where x = SpecialEventStarts.txt
| do what I want you to do
| where x = EventEnds.txt
| #do what I want you to do
| where x = SpecialEventEnds.txt
| do what I want you to do
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I know when the where condition stops???&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 17:15:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283487#M85666</guid>
      <dc:creator>jsven7</dc:creator>
      <dc:date>2015-10-19T17:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283488#M85667</link>
      <description>&lt;P&gt;This is likely a use case for transaction command.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Transaction"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Transaction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;something along the lines of&lt;/P&gt;

&lt;P&gt;base search | transaction startswith=EventStarts.txt endswith=EventEnds.txt&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 18:29:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283488#M85667</guid>
      <dc:creator>GeorgeStarkey</dc:creator>
      <dc:date>2015-10-19T18:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283489#M85668</link>
      <description>&lt;P&gt;Are you getting these events by forwarding them in (monitoring the files) or by using &lt;CODE&gt;inputlookup&lt;/CODE&gt; (or &lt;CODE&gt;inputcsv&lt;/CODE&gt;)?  If the former, which date are you using for your timestamp ( &lt;CODE&gt;_time&lt;/CODE&gt; )?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 18:31:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283489#M85668</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-19T18:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283490#M85669</link>
      <description>&lt;P&gt;It depends on "do what I want you to do" whether it can be achieved by simple where clause or using transaction OR other commands. Could you provide more details on what you want to do here, how the Start and End will be correlated etc?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 18:53:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283490#M85669</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-19T18:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283491#M85670</link>
      <description>&lt;P&gt;I am assuming that for &lt;CODE&gt;EventEnds.txt&lt;/CODE&gt; and &lt;CODE&gt;SpecialEventEnds.txt&lt;/CODE&gt; you actually have &lt;CODE&gt;End Date&lt;/CODE&gt; and not &lt;CODE&gt;Start Date&lt;/CODE&gt;, right?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 19:16:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283491#M85670</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-19T19:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283492#M85671</link>
      <description>&lt;P&gt;You have not specified what you are really trying to do so we have to guess quite a bit but, assuming that you have forwarded in these events from files, you can do something like this and maybe this gets you far enough along to finish it for yourself:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* source="*EventStarts.txt" OR source="*SpecialEventStarts.txt" OR source="*EventEnds.txt" OR source="*SpecialEventEnds.txt" | eval special=if(like(source, "%Special%"), "Special", "Normal") | stats values(*) AS * by user special
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Oct 2015 19:17:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283492#M85671</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-19T19:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283493#M85672</link>
      <description>&lt;P&gt;I uploaded CSVs to test it out but the idea is to get these events from monitoring files.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 12:54:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283493#M85672</guid>
      <dc:creator>jsven7</dc:creator>
      <dc:date>2015-10-21T12:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283494#M85673</link>
      <description>&lt;P&gt;That's right. My plan to match them up is to use the Start and End Dates. So to do this in the code I was thinking I'd need to use the Where function to execute lines of code only for a specific sourcetype and then move on to the next. &lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 12:56:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283494#M85673</guid>
      <dc:creator>jsven7</dc:creator>
      <dc:date>2015-10-21T12:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283495#M85674</link>
      <description>&lt;P&gt;In the "do what I want you to do" I plan on identifying the date/time of the records and match them up chronologically.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 12:58:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283495#M85674</guid>
      <dc:creator>jsven7</dc:creator>
      <dc:date>2015-10-21T12:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283496#M85675</link>
      <description>&lt;P&gt;eval special=if(like(source, "%Special%"), "Special", "Normal") &lt;/P&gt;

&lt;P&gt;OK. Woodcock I'm thinking instead of a where condition I can use the if condition to determine the sourcetype. Sort of a similar problem though. I understand that the "Special" portion of the above line represents the executable if the if equals true and the "Normal" is the else. How do I perform multiple lines of executables when the if equals to true?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 13:02:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283496#M85675</guid>
      <dc:creator>jsven7</dc:creator>
      <dc:date>2015-10-21T13:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283497#M85676</link>
      <description>&lt;P&gt;Unfortunately, you have to stack more &lt;CODE&gt;| eval x=if()&lt;/CODE&gt; clauses into the pipeline.  There may be more tricky options but I would need to know exactly what you are trying to do.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 16:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283497#M85676</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-21T16:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple where conditions in a search to match and correlate start and end time fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283498#M85677</link>
      <description>&lt;P&gt;Ok. Thanks I appreciate your help.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 11:56:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-where-conditions-in-a-search-to-match-and/m-p/283498#M85677</guid>
      <dc:creator>jsven7</dc:creator>
      <dc:date>2015-10-22T11:56:22Z</dc:date>
    </item>
  </channel>
</rss>

