<?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: help with an inputlookup issue in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452881#M171318</link>
    <description>&lt;P&gt;yes, use return, not table.&lt;/P&gt;

&lt;P&gt;In case you dont have the same field in both, I suggest you stay on the HOSTNAME field and create an alias for it in your index=x. That way you don't rely on the "host" field it self. Then in the csv use HOSTNAME instead of host.&lt;/P&gt;

&lt;P&gt;If you'd rather keep thing as they are without making aliases then it should look something like that : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index="x" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="x:view_splunk_assets") 
| rename HOSTNAME as host 
|search [| inputlookup host.csv | return 9999 host] 
| stats earliest(_time) as _time values(SITE) as SITE values(ROOM) as ROOM values(TOWN) as TOWN values(CLIENT_USER) as CLIENT_USER values(COUNTRY) as COUNTRY values(OS) as OS by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 13 May 2019 09:34:58 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-05-13T09:34:58Z</dc:date>
    <item>
      <title>help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452871#M171308</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;
I use the search below wich runs perfectly&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index="X" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=* (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="itop:view_splunk_assets")
 | eval host=coalesce(HOSTNAME,host)
 | eval time=if(EventCode="*",_time,null())
 | stats values(sourcetype) as sts max(time) as _time values(SITE) as SITE values(ROOM) as ROOM values(TOWN) as TOWN values(CLIENT_USER) as CLIENT_USER values(COUNTRY) as COUNTRY values(OS) as OS by host
 | where NOT (mvcount(sts)=1 AND sts="X:view_splunk_assets")
  | table _time host COUNTRY TOWN SITE ROOM CLIENT_USER OS 
  | sort -_time – COUNTRY
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I need to do the search from a list of host in a csv file&lt;BR /&gt;
So I put  [|inputlookup host.csv | table host] at the beginning of my search but it doesn't works even if I am sure that events exists between my CSV file&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;**[|inputlookup host.csv | table host]** (index="x" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=* (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="itop:view_splunk_assets")
 | eval host=coalesce(HOSTNAME,host)
 | eval time=if(EventCode="*",_time,null())
 | stats values(sourcetype) as sts max(time) as _time values(SITE) as SITE values(ROOM) as ROOM values(TOWN) as TOWN values(CLIENT_USER) as CLIENT_USER values(COUNTRY) as COUNTRY values(OS) as OS by host
 | where NOT (mvcount(sts)=1 AND sts="x:view_splunk_assets")
  | table _time host COUNTRY TOWN SITE ROOM CLIENT_USER OS 
  | sort -_time – COUNTRY
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;what is strange is that when I specify an hostname which also exists in my csv file, I have results and the 2 indexes I query&lt;/P&gt;

&lt;P&gt;I have another issue with the field _time &lt;BR /&gt;
I want to catch the field _time when  an event for index="X" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=* (Level=1 OR Level=2 OR Level=3) occurs&lt;BR /&gt;
For the moment the field _time which is displayed is the _time when I run the query....&lt;BR /&gt;
Could you help me please??&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 12:28:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452871#M171308</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-10T12:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452872#M171309</link>
      <description>&lt;P&gt;Do you have "hostname" in your CSV or "host"?&lt;/P&gt;

&lt;P&gt;Please try like..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[|inputlookup host.csv | fields host] (index="ai-wkst-wineventlog-fr" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=* (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="itop:view_splunk_assets")
| ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 May 2019 12:46:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452872#M171309</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-10T12:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452873#M171310</link>
      <description>&lt;P&gt;hello&lt;BR /&gt;
i have host in my CSV&lt;BR /&gt;
and your code doesnt works....&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 13:10:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452873#M171310</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-10T13:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452874#M171311</link>
      <description>&lt;P&gt;Hello all&lt;BR /&gt;
Could you have a look to my issue?&lt;BR /&gt;
I need help please &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 05:15:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452874#M171311</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-13T05:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452875#M171312</link>
      <description>&lt;P&gt;I have done this I dont succeed to match with index=x sourcetype="x:view_splunk_assets" &lt;BR /&gt;
    index="x" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=* (Level=1 OR Level=2 OR Level=3) &lt;BR /&gt;
        [| inputlookup host.csv &lt;BR /&gt;
        | table host] &lt;BR /&gt;
    | dedup host &lt;BR /&gt;
    | table _time host EventCode &lt;BR /&gt;
    | join type=left host &lt;BR /&gt;
        [ search index=x sourcetype="x:view_splunk_assets" &lt;BR /&gt;
        | stats count by HOSTNAME SITE ROOM TOWN CLIENT_USER COUNTRY OS &lt;BR /&gt;
        | fields - count &lt;BR /&gt;
        | rename HOSTNAME as host] &lt;BR /&gt;
    | table _time host COUNTRY TOWN SITE ROOM CLIENT_USER OS &lt;BR /&gt;
    | sort -_time limit=10&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:32:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452875#M171312</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-09-30T00:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452876#M171313</link>
      <description>&lt;P&gt;If there is any other  in the lookup to use as destination field (for example just add a field "found" with value 1) - why not use &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index="X" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=* (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="itop:view_splunk_assets") | lookup host.csv host output found | where found=1 |...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 May 2019 06:15:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452876#M171313</guid>
      <dc:creator>nabeel652</dc:creator>
      <dc:date>2019-05-13T06:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452877#M171314</link>
      <description>&lt;P&gt;yes you have right&lt;BR /&gt;
it works with lookup instead lookup&lt;BR /&gt;
I have done this :&lt;BR /&gt;
    (index="x" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=* (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="xview_splunk_assets") &lt;BR /&gt;
    | rename HOSTNAME as host &lt;BR /&gt;
    | lookup host.csv host OUTPUT host &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(SITE) as SITE values(ROOM) as ROOM values(TOWN) as TOWN values(CLIENT_USER) as CLIENT_USER values(COUNTRY) as COUNTRY values(OS) as OS by host 
| table _time host COUNTRY TOWN SITE ROOM CLIENT_USER OS 
| sort -_time - COUNTRY limit=10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have just an issue with _time&lt;BR /&gt;
I want to retrieve the field _time which correspond to the time of event creation time in index="x" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=* (Level=1 OR Level=2 OR Level=3) &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:32:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452877#M171314</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-09-30T00:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452878#M171315</link>
      <description>&lt;P&gt;Hi @jip31,&lt;/P&gt;

&lt;P&gt;Seems like you've got quite the challenge there. This will do the trick for filtering only the hosts that are in the CSV file  : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index="ai-wkst-wineventlog-fr" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=* (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="itop:view_splunk_assets")  [|inputlookup host.csv | return 9999 host] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More info about using the return command can be found here : &lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Return"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Return&lt;/A&gt;&lt;BR /&gt;
If you need to put the results in tabular format and still keep the earliest time then you can go append this &lt;CODE&gt;stats&lt;/CODE&gt; search : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | stats earliest(_time) as _time values(SITE) as SITE values(ROOM) as ROOM values(TOWN) as TOWN values(CLIENT_USER) as CLIENT_USER values(COUNTRY) as COUNTRY values(OS) as OS by host 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know how that works out for you.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 07:33:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452878#M171315</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-13T07:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452879#M171316</link>
      <description>&lt;P&gt;oh I just realize that there is no matching with lookup host.csv because if I add a specific eventcode I have always results even if there is no events for this eventcode.......&lt;/P&gt;

&lt;P&gt;(index="X" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=6008 (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="X:view_splunk_assets") &lt;BR /&gt;
| rename HOSTNAME as host &lt;BR /&gt;
| lookup host.csv host OUTPUT host &lt;BR /&gt;
| stats values(SITE) as SITE values(ROOM) as ROOM values(TOWN) as TOWN values(CLIENT_USER) as CLIENT_USER values(COUNTRY) as COUNTRY values(OS) as OS by host&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:32:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452879#M171316</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-09-30T00:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452880#M171317</link>
      <description>&lt;P&gt;hi david&lt;BR /&gt;
can you confirm that   [| inputlookup host.csv &lt;BR /&gt;
    | return 9999 host] is just used for testing my subsearch&lt;BR /&gt;
or does it replace [| inputlookup host.csv | table host]??&lt;/P&gt;

&lt;P&gt;and if i am doing this I have any results...&lt;BR /&gt;
    (index="x" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="x:view_splunk_assets") &lt;BR /&gt;
        [| inputlookup host.csv &lt;BR /&gt;
        | table host] &lt;BR /&gt;
    | rename HOSTNAME as host &lt;BR /&gt;
    | stats earliest(_time) as _time values(SITE) as SITE values(ROOM) as ROOM values(TOWN) as TOWN values(CLIENT_USER) as CLIENT_USER values(COUNTRY) as COUNTRY values(OS) as OS by host&lt;/P&gt;

&lt;P&gt;PS : in index=master-data-lookups sourcetype="x:view_splunk_assets" the fields host is called HOSTNAME so I have added a rename HOSTNAME as host&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:33:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452880#M171317</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-09-30T00:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452881#M171318</link>
      <description>&lt;P&gt;yes, use return, not table.&lt;/P&gt;

&lt;P&gt;In case you dont have the same field in both, I suggest you stay on the HOSTNAME field and create an alias for it in your index=x. That way you don't rely on the "host" field it self. Then in the csv use HOSTNAME instead of host.&lt;/P&gt;

&lt;P&gt;If you'd rather keep thing as they are without making aliases then it should look something like that : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index="x" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="x:view_splunk_assets") 
| rename HOSTNAME as host 
|search [| inputlookup host.csv | return 9999 host] 
| stats earliest(_time) as _time values(SITE) as SITE values(ROOM) as ROOM values(TOWN) as TOWN values(CLIENT_USER) as CLIENT_USER values(COUNTRY) as COUNTRY values(OS) as OS by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 May 2019 09:34:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452881#M171318</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-13T09:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452882#M171319</link>
      <description>&lt;P&gt;David&lt;BR /&gt;
There is something which doesnt works because if I put an eventcode which dont exists like eventcode=a I have all the same events displayed...&lt;BR /&gt;
Have you an idea please??&lt;/P&gt;

&lt;P&gt;(index="ai-wkst-wineventlog-fr" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" &lt;STRONG&gt;EventCode=a&lt;/STRONG&gt; (Level=1 OR Level=2 OR Level=3)) OR (index=master-data-lookups sourcetype="itop:view_splunk_assets") &lt;BR /&gt;
| rename HOSTNAME as host &lt;BR /&gt;
| search &lt;BR /&gt;
    [| inputlookup host.csv &lt;BR /&gt;
    | return 9999 host] &lt;BR /&gt;
| stats earliest(_time) as _time values(SITE) as SITE values(ROOM) as ROOM values(TOWN) as TOWN values(CLIENT_USER) as CLIENT_USER values(COUNTRY) as COUNTRY values(OS) as OS by host&lt;IMG src="http://" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:33:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452882#M171319</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-09-30T00:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452883#M171320</link>
      <description>&lt;P&gt;and _time needs to correspond to the time when an event for (index="ai-wkst-wineventlog-fr" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=a (Level=1 OR Level=2 OR Level=3) occurs...&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 11:20:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452883#M171320</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-13T11:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452884#M171321</link>
      <description>&lt;P&gt;yeah that's normal, because you will still get events from &lt;CODE&gt;index=master-data-lookups sourcetype="itop:view_splunk_assets"&lt;/CODE&gt; if you apply a wrong event code to the first part of your code &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;As for the time, which one occurs first ? You can use earliest and latest based on that to have only this time to show&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 11:52:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452884#M171321</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-13T11:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452885#M171322</link>
      <description>&lt;P&gt;But if the event code is wrong I want that any events are displayed and if I put a specific event code I need that only the events corresponding are displayed&lt;BR /&gt;
What is the solution to do this please???&lt;BR /&gt;
For the time I would have the time when an event corresponding to (index="ai-wkst-wineventlog-fr" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=1000 (Level=1 OR Level=2 OR Level=3)) occurs&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 15:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452885#M171322</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-13T15:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452886#M171323</link>
      <description>&lt;P&gt;easiest solution I can think of is to alias time as something else for sourcetype=XmlWinEventLog, and use that field instead of the _time, that way you're sure to get the right one &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 15:50:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452886#M171323</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-13T15:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452887#M171324</link>
      <description>&lt;P&gt;I have done something else&lt;BR /&gt;
as index=master-data-lookups sourcetype="itop:view_splunk_assets") is equal to | lookup lookup_cmdb_fo_all.csv i have written the code below&lt;/P&gt;

&lt;P&gt;(index="ai-wkst-wineventlog-fr" sourcetype=XmlWinEventLog source="XmlWinEventLog:System" EventCode=37 (Level=1 OR Level=2 OR Level=3)) &lt;BR /&gt;
    [| inputlookup host.csv &lt;BR /&gt;
    | table host] &lt;BR /&gt;
| table _time host EventCode &lt;BR /&gt;
| lookup lookup_cmdb_fo_all.csv HOSTNAME as host &lt;BR /&gt;
| stats max(_time) as _time values(SITE) as SITE values(ROOM) as ROOM values(TOWN) as TOWN values(CLIENT_USER) as CLIENT_USER values(COUNTRY) as COUNTRY values(OS) as OS by host&lt;/P&gt;

&lt;P&gt;now I have the time of the event for event code and I am also able to display events for a specific event code!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:33:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452887#M171324</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-09-30T00:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: help with an inputlookup issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452888#M171325</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| lookup host.csv host OUTPUT host 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will not work you cannot output same field that you are looking up. You will have to create a separate field for example like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup host.csv | eval found=1 | outputlookup host.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup host.csv host OUTPUT found | where found=1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 May 2019 04:02:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-an-inputlookup-issue/m-p/452888#M171325</guid>
      <dc:creator>nabeel652</dc:creator>
      <dc:date>2019-05-15T04:02:41Z</dc:date>
    </item>
  </channel>
</rss>

