<?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: Create a search using data from csv and grabbing the latest timestamps for multiple queries in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631059#M219193</link>
    <description>&lt;P&gt;I could fix it - thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;- your solution pointed me to the right direction&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2023 20:25:48 GMT</pubDate>
    <dc:creator>GhanaRusk</dc:creator>
    <dc:date>2023-02-15T20:25:48Z</dc:date>
    <item>
      <title>How to create a search using data from csv and grabbing the latest timestamps for multiple queries?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/630914#M219163</link>
      <description>&lt;P&gt;I've a couple of queries -&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;index="main"app="student-api" "tags.studentId"=3B70E5 message="Id and pwd entered correctly" | sort _time desc&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;and&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;index="main" app="student-api" "tags.decision"=SOP_REQUIRED "tags.studentId"=3B70E5 | sort _time desc&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I'd like to grab just the latest timestamp from both the results (and status code from one of them). However I'd like to do this reading the&amp;nbsp;&lt;EM&gt;tags.studentId&lt;/EM&gt; from a csv file (the fieldname is &lt;EM&gt;student_id &lt;/EM&gt;and has ~100 entries). So the output should look like -&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;student_id| latest timestamp from 1st query|&amp;nbsp;latest timestamp from 2nd query|status code from 2nd query&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;I installed Lookup Editor.&amp;nbsp; Please let me know what next steps to follow (if there is alternative to Lookup Editor please suggest that too).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 20:52:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/630914#M219163</guid>
      <dc:creator>GhanaRusk</dc:creator>
      <dc:date>2023-02-15T20:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/630918#M219165</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;thoughts on this one?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 07:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/630918#M219165</guid>
      <dc:creator>GhanaRusk</dc:creator>
      <dc:date>2023-02-15T07:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/630921#M219166</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251436"&gt;@GhanaRusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you want only the latest event, you can add Head 1 to your search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main"app="student-api" "tags.studentId"=3B70E5 message="Id and pwd entered correctly" 
| sort _time desc
| head 1&lt;/LI-CODE&gt;&lt;P&gt;I don't understand what you mean when you say: "&lt;SPAN&gt;I'd like to do this using data from a csv file".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Anyway, you can correlate the two searches using the stats command:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main"app="student-api" (("tags.studentId"=3B70E5 message="Id and pwd entered correctly") OR ("tags.decision"=SOP_REQUIRED "tags.studentId"=3B70E5)) 
| stats 
   latest(eval(if(message="Id and pwd entered correctly",_time,""))) AS  latest_timestamp_from_1st_query
   latest(eval(if("tags.decision"=SOP_REQUIRED,_time,""))) AS latest timestamp_from_2nd_query
   last(eval(if("tags.decision"=SOP_REQUIRED,status_code,""))) AS status_code
   BY student_id&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 07:39:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/630921#M219166</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-02-15T07:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/630931#M219167</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main"app="student-api" (message="Id and pwd entered correctly" OR "tags.decision"=SOP_REQUIRED) [|inputlookup students.csv
  | fields tags.studentId]
| stats latest(eval(if(message=="Id and pwd entered correctly",_time,null()))) as first_timestamp latest(eval(if('tags.decision'=="SOP_REQUIRED",_time,null()))) as second_timestamp latest(eval(if('tags.decision'=="SOP_REQUIRED",status,null()))) as status by tags.studentId&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Feb 2023 09:39:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/630931#M219167</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-15T09:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631019#M219183</link>
      <description>&lt;P&gt;Thanks - I meant I've a csv with student ids that I'd like to use as input to the query&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 18:14:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631019#M219183</guid>
      <dc:creator>GhanaRusk</dc:creator>
      <dc:date>2023-02-15T18:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631023#M219184</link>
      <description>&lt;P&gt;thanks - this is not yielding results - I think we've to use the student_id in csv - where are we doing that?&lt;BR /&gt;(I mean the csv header is student_id while the query needs tags.studentId)&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 18:26:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631023#M219184</guid>
      <dc:creator>GhanaRusk</dc:creator>
      <dc:date>2023-02-15T18:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631024#M219185</link>
      <description>&lt;P&gt;Try it like this then&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main"app="student-api" (message="Id and pwd entered correctly" OR "tags.decision"=SOP_REQUIRED) [|inputlookup students.csv
  | fields student_id
  | rename student_id as "tags.studentId"]
| stats latest(eval(if(message=="Id and pwd entered correctly",_time,null()))) as first_timestamp latest(eval(if('tags.decision'=="SOP_REQUIRED",_time,null()))) as second_timestamp latest(eval(if('tags.decision'=="SOP_REQUIRED",status,null()))) as status by tags.studentId&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Feb 2023 18:33:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631024#M219185</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-15T18:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631034#M219189</link>
      <description>&lt;P&gt;thanks - getting closer - I tried&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main"app="student-api" (message="Id and pwd entered correctly" OR "tags.decision"=SOP_REQUIRED) [|inputlookup students.csv
  | fields student_id
  | rename student_id as "tags.studentId"]
| stats latest(eval(if(message=="Id and pwd entered correctly",_time,null()))) as first_timestamp latest(eval(if('tags.decision'=="SOP_REQUIRED",_time,null()))) as second_timestamp by tags.studentId&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;the studentId is showing up but the timestamps are empty - I ran the query separately and I see the events showing up as expected.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 18:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631034#M219189</guid>
      <dc:creator>GhanaRusk</dc:creator>
      <dc:date>2023-02-15T18:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631045#M219191</link>
      <description>&lt;P&gt;Also I just tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main" app="student-api" tags.studentId=3B70E5 (message="Id and pwd entered correctly" OR "tags.decision"=SOP_REQUIRED) | stats latest(_time) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the timestamp came up like 1675785328.602059&lt;BR /&gt;Do we need to do some conversion?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 19:53:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631045#M219191</guid>
      <dc:creator>GhanaRusk</dc:creator>
      <dc:date>2023-02-15T19:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631059#M219193</link>
      <description>&lt;P&gt;I could fix it - thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;- your solution pointed me to the right direction&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 20:25:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631059#M219193</guid>
      <dc:creator>GhanaRusk</dc:creator>
      <dc:date>2023-02-15T20:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631144#M219216</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251436"&gt;@GhanaRusk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Please accept one answer for the other people of Community&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 07:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631144#M219216</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-02-16T07:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search using data from csv and grabbing the latest timestamps for multiple queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631230#M219252</link>
      <description>&lt;P&gt;I did - thanks&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 17:54:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-using-data-from-csv-and-grabbing-the/m-p/631230#M219252</guid>
      <dc:creator>GhanaRusk</dc:creator>
      <dc:date>2023-02-16T17:54:25Z</dc:date>
    </item>
  </channel>
</rss>

