<?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: Extracting users from a list in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-users-from-a-list/m-p/525328#M148227</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=log max_match=0 "\[{0,}\'(?P&amp;lt;output&amp;gt;[^',]+)" 
| mvexpand output 
| table output&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 19 Oct 2020 10:38:57 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2020-10-19T10:38:57Z</dc:date>
    <item>
      <title>Extracting users from a list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-users-from-a-list/m-p/525280#M148211</link>
      <description>&lt;PRE&gt;2020-10-19 05:00:03,744 INFO main() Deletion list: ['user1', 'user2', '$template', 'user233', 'svc_user1', ]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I have this log file that outputs a list of users to be deleted.&lt;BR /&gt;I want to search this output and extract the users into fields then exclude the $template* &amp;amp; svc_users* users.&lt;/P&gt;&lt;P&gt;I have tried this to extract the users to field.&lt;/P&gt;&lt;P&gt;&amp;nbsp; search "list:" | eval del_users=split(_raw,"', '") | table del_users&lt;BR /&gt;&lt;BR /&gt;output looks like:&lt;/P&gt;&lt;DIV class="multivalue-subcell lia-indent-padding-left-30px"&gt;2020-10-19 05:00:03,744 INFO main() Deletion list: ['user1&lt;/DIV&gt;&lt;DIV class="multivalue-subcell lia-indent-padding-left-30px"&gt;user2&lt;/DIV&gt;&lt;DIV class="multivalue-subcell lia-indent-padding-left-30px"&gt;$template&lt;/DIV&gt;&lt;DIV class="multivalue-subcell lia-indent-padding-left-30px"&gt;user233&lt;/DIV&gt;&lt;DIV class="multivalue-subcell lia-indent-padding-left-30px"&gt;svc_user1&lt;/DIV&gt;&lt;DIV class="multivalue-subcell lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Any suggestions to get a better output or how I should be doing this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 02:50:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-users-from-a-list/m-p/525280#M148211</guid>
      <dc:creator>ryangillan</dc:creator>
      <dc:date>2020-10-19T02:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting users from a list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-users-from-a-list/m-p/525282#M148213</link>
      <description>&lt;P&gt;did you check the "rex" regular expression...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval log="2020-10-19 05:00:03,744 INFO main() Deletion list: ['user1', 'user2', '$template', 'user233', 'svc_user1', ]" 
| rex field=log "\[(?&amp;lt;del_users&amp;gt;.*)\, \]" 
| table del_users&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT - verified and adding the screenshot:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rex-del-users.jpg" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11351iB0661CB8F0ECC312/image-size/large?v=v2&amp;amp;px=999" role="button" title="rex-del-users.jpg" alt="rex-del-users.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 03:32:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-users-from-a-list/m-p/525282#M148213</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-10-19T03:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting users from a list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-users-from-a-list/m-p/525328#M148227</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=log max_match=0 "\[{0,}\'(?P&amp;lt;output&amp;gt;[^',]+)" 
| mvexpand output 
| table output&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 19 Oct 2020 10:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-users-from-a-list/m-p/525328#M148227</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-10-19T10:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting users from a list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-users-from-a-list/m-p/525639#M148352</link>
      <description>&lt;P&gt;This looks like what I need.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;|search "list:" | rex field=log "\[(?&amp;lt;del_users&amp;gt;.*)\, \]" | eval users=split(_raw,"', '") | mvexpand users
|search NOT users IN ("$*templat*","svc*") | table users&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 21:09:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-users-from-a-list/m-p/525639#M148352</guid>
      <dc:creator>ryangillan</dc:creator>
      <dc:date>2020-10-20T21:09:19Z</dc:date>
    </item>
  </channel>
</rss>

