<?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: Delete rows in a CSV lookup file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522176#M147230</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226635"&gt;@Sasquatchatmars&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as I said, you have to install the&amp;nbsp;&lt;SPAN&gt;SA-LdapSearch (&lt;A href="https://splunkbase.splunk.com/app/1151/" target="_blank"&gt;https://splunkbase.splunk.com/app/1151/&lt;/A&gt;) or the Add-on for LDAP (&lt;A href="https://splunkbase.splunk.com/app/1852/#/details" target="_blank"&gt;https://splunkbase.splunk.com/app/1852/#/details&lt;/A&gt;) that gives you a search to extract data from Active Directory.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then you have to run a search like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup your_lookup.csv
| search [ | ldapsearch domain=your_domain search="(objectClass=user)" | fields user ]
| table user Time
| outputlookup your_lookup.csv&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 07:24:17 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-09-30T07:24:17Z</dc:date>
    <item>
      <title>Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/521967#M147167</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have succesfully made a search to populate a CSV file thanks to &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;, this file lets me add Usernames and timestamps to monitor their last succesfull logon. Now after a certain time i would like to delete some rows &lt;STRONG&gt;&lt;U&gt;without&lt;/U&gt;&lt;/STRONG&gt; overwriting the file.&amp;nbsp; If possible i want to check in the AD if&amp;nbsp; the user list is the same as&amp;nbsp; in the CSV file. If a certain user is not in the AD anymore, that usernames row needs to be deleted in the CSV file. Can anyone help me create a search to delete those rows if this is possible? Otherwise i will have to do it manually or via an other script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an example of the CSV file that is generated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;     Time             |            User
 ---------------------------------------------
  1601341200          |          User_Alpha
  1601348400          |          User_Beta
  1601355600          |          User_Charlie&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:51:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/521967#M147167</guid>
      <dc:creator>Sasquatchatmars</dc:creator>
      <dc:date>2020-09-29T11:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/521973#M147169</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226635"&gt;@Sasquatchatmars&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to run a search that takes all the rows fron the lookup and filter them with the AD.&lt;/P&gt;&lt;P&gt;In other words you have to extract the user list from AD putthing this list e.g. in a lookup and then filter the main lookup, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup your_lookup.csv
| search [ | inputlookup AD_lookup.csv | fields user ]
| table user Time
| outputlookup your_lookup.csv&lt;/LI-CODE&gt;&lt;P&gt;Cao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:39:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/521973#M147169</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-29T12:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/521980#M147172</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;If I understand correctly, I will have to do this in the following order?&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Search the AD to retrieve all usernames&lt;/LI&gt;&lt;LI&gt;Put the result in a lookup csv file&lt;/LI&gt;&lt;LI&gt;Apply your search to filter out the unwanted users.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If I'm doing it with your search it isn't supposed to delete the other entries, right?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:01:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/521980#M147172</guid>
      <dc:creator>Sasquatchatmars</dc:creator>
      <dc:date>2020-09-29T13:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522001#M147174</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226635"&gt;@Sasquatchatmars&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You have two way to proceed:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;if you need a quick answer, the extraction od AD users in a lookup is the best approach,&lt;/LI&gt;&lt;LI&gt;if you have to update your main lookup once a day you don't need to pass through the lookup.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if you have a search to query AD (e.g. using the&amp;nbsp;&lt;SPAN&gt;SA-LdapSearch), you don't need to pass for a lookup you can also use it in the search.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This depends on the response time you're waiting for, in other words, if you have to run this search once a day to update your main lookup, you can also directly use the Ldap extraction without passing through the lookup, if instead you want a search that quickly answers you have to pass for the lookup because the AD extraction is really slow.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:03:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522001#M147174</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-29T14:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522171#M147228</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I don't need a really fast query, it will run every week or every month at midnight when nothing else runs. I already noticed that it took quit some time for a search to have results. Is it possible for you to give me the search needed to update the CSV file then? It has only been a couple of weeks for me, so I'm still learning.&amp;nbsp;&lt;BR /&gt;So the CSV file can not loose any fields if the are no changes and if there is a user delete in AD, it needs to be deleted in my CSV file that contains the users and logon timestamps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 06:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522171#M147228</guid>
      <dc:creator>Sasquatchatmars</dc:creator>
      <dc:date>2020-09-30T06:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522176#M147230</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226635"&gt;@Sasquatchatmars&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as I said, you have to install the&amp;nbsp;&lt;SPAN&gt;SA-LdapSearch (&lt;A href="https://splunkbase.splunk.com/app/1151/" target="_blank"&gt;https://splunkbase.splunk.com/app/1151/&lt;/A&gt;) or the Add-on for LDAP (&lt;A href="https://splunkbase.splunk.com/app/1852/#/details" target="_blank"&gt;https://splunkbase.splunk.com/app/1852/#/details&lt;/A&gt;) that gives you a search to extract data from Active Directory.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then you have to run a search like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup your_lookup.csv
| search [ | ldapsearch domain=your_domain search="(objectClass=user)" | fields user ]
| table user Time
| outputlookup your_lookup.csv&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 07:24:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522176#M147230</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-30T07:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522204#M147246</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I have already installed &lt;SPAN&gt;SA-LdapSearch.&amp;nbsp;&lt;/SPAN&gt;I used exactly your search but it returned "no results found".&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 09:49:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522204#M147246</guid>
      <dc:creator>Sasquatchatmars</dc:creator>
      <dc:date>2020-09-30T09:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522207#M147249</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226635"&gt;@Sasquatchatmars&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at first see if the LDAP query gives you results,&lt;/P&gt;&lt;P&gt;then&amp;nbsp;compare them with the lookup ones to see if the format is the same.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 10:12:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522207#M147249</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-30T10:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522233#M147252</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I verified everything, I separated the searches to see if they work individually and I have no problem.&lt;BR /&gt;Could it be that there are no results because he doesn't see any change between both results?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 11:50:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522233#M147252</guid>
      <dc:creator>Sasquatchatmars</dc:creator>
      <dc:date>2020-09-30T11:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522234#M147253</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226635"&gt;@Sasquatchatmars&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;To check this, manually add a row in the lookup and run again the search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 11:57:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522234#M147253</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-30T11:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows in a CSV lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522247#M147258</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I tried it but it but the search actually deleted every input in the file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 12:46:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delete-rows-in-a-CSV-lookup-file/m-p/522247#M147258</guid>
      <dc:creator>Sasquatchatmars</dc:creator>
      <dc:date>2020-09-30T12:46:53Z</dc:date>
    </item>
  </channel>
</rss>

