<?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 can I filter different values from the same field ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381595#M111606</link>
    <description>&lt;P&gt;But still, I will upvote @woodcock solution, as for someone that will be definitely helpful. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jan 2019 06:13:05 GMT</pubDate>
    <dc:creator>pgadhari</dc:creator>
    <dc:date>2019-01-09T06:13:05Z</dc:date>
    <item>
      <title>How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381580#M111591</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;

&lt;P&gt;I have a field called "Login" in my events, which has various types of values such as "&lt;A href="mailto:1111@domain1.com"&gt;1111@domain1.com&lt;/A&gt;", "&lt;A href="mailto:temp-username@domain1.com"&gt;temp-username@domain1.com&lt;/A&gt;, "&lt;A href="mailto:security@domain1.com"&gt;security@domain1.com&lt;/A&gt;", "&lt;A href="mailto:serviceaccounts@domain1.com"&gt;serviceaccounts@domain1.com&lt;/A&gt;".&lt;/P&gt;

&lt;P&gt;Now, here I want to create 2 panels, wherein in one panel, it would show only the actual users count considering  ( &lt;CODE&gt;1111&lt;/CODE&gt;, &lt;CODE&gt;temp-*&lt;/CODE&gt;, &amp;amp; &lt;CODE&gt;*security*&lt;/CODE&gt; ) — this would show only users, while the second panel would show only serviceaccounts, which are used by services. This way I can display actual users and service accounts in our application. &lt;/P&gt;

&lt;P&gt;Please help me figure out how to achieve this.&lt;/P&gt;

&lt;P&gt;Regards&lt;BR /&gt;
PG&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 08:25:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381580#M111591</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2018-12-27T08:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381581#M111592</link>
      <description>&lt;P&gt;How do you differentiate between user accounts and service accounts? Do all service accounts start with "serviceaccounts@"?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 08:40:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381581#M111592</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2018-12-27T08:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381582#M111593</link>
      <description>&lt;P&gt;No, every service account will have the name as "&lt;A href="mailto:oracleapp@domain1.com"&gt;oracleapp@domain1.com&lt;/A&gt;", "&lt;A href="mailto:oracledb@domain1.com"&gt;oracledb@domain1.com&lt;/A&gt;" etc.. based on specific applications for which the account is created. Actually the logic would be like - if I filter "1111", "temp-" &amp;amp; "&lt;EM&gt;security&lt;/EM&gt;" from that Login field, I should be able to differentiate between those accounts, but I am finding little bit difficult to do that filtering on a single field. Appreciate if you can help in this ? Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 08:50:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381582#M111593</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2018-12-27T08:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381583#M111594</link>
      <description>&lt;P&gt;Since you want 2 separate panels (perhaps single value panels), this could be your search for actual user accounts:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| your base search
| search Login="1111@*" OR Login="temp-username@*" OR Login="security@*"
| stats dc(Login) as User_Accounts
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search for service accounts is just negated:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| your base search
| search Login!="1111@*" Login!="temp-username@*" Login!="security@*"
| stats dc(Login) as Service_Accounts
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Dec 2018 09:40:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381583#M111594</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2018-12-27T09:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381584#M111595</link>
      <description>&lt;P&gt;Actually, "1111" is just an example I have given. This value consists of all the empid of 3000 employees (which is between 1 to 4 digits), I want to filter all those values that start with &lt;A href="mailto:dddd@domain1.com"&gt;dddd@domain1.com&lt;/A&gt;, rest "temp-*" and security value I can filter. The only challenge is I want to filter "1111", "2222", "22","333" and so on. There I am facing the challenge. Please help.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 09:49:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381584#M111595</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2018-12-27T09:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381585#M111596</link>
      <description>&lt;P&gt;How about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| your base search
| eval Is_User_Account=if(match(Login,"^\d{1,4}@") OR match(Login,"^temp-") OR match(Login,"^security"),"yes","no")
| search Is_User_Account="yes"
| stats dc(Login) as User_Accounts
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;search Is_User_Account="no" for service accounts.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:32:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381585#M111596</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2020-09-29T22:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381586#M111597</link>
      <description>&lt;P&gt;Actually, this query will show the count, but I want to show the usernames also in the table, as to who are normal user accounts and who are service accounts. This I will be showing in a table with giving 2 radio button like - Normal Account      Service Accounts:&lt;/P&gt;

&lt;P&gt;So if the person, select Normal Account radio button, all those shud be listed and if the person selects "Generic Account" radio button, all generic accounts should be displayed. Please help in that regards ? Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 11:06:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381586#M111597</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2018-12-27T11:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381587#M111598</link>
      <description>&lt;P&gt;Hi whrg.. can you please reply on my latest comment ? Actually I need to resolve this issue at the earliest please. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 12:41:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381587#M111598</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2018-12-27T12:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381588#M111599</link>
      <description>&lt;P&gt;If you want a table of all accounts along with their respective status, then try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| your base search
| dedup Login
| eval Is_User_Account=if(match(Login,"^\d{1,4}@") OR match(Login,"^temp-") OR match(Login,"^security"),"yes","no")
| table Login,Is_User_Account
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can filter for the type of account via a token, which is set by a radio button, after the eval command.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 16:26:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381588#M111599</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2018-12-27T16:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381589#M111600</link>
      <description>&lt;P&gt;Ya this is working great. But I just figured out that, this field "Login" which I am using is having only email ids (&lt;A href="mailto:xxxx@domain1.com"&gt;xxxx@domain1.com&lt;/A&gt;), it is not showing the Name of the person, instead it is showing empid, temp-*, &amp;amp; service accounts emails. &lt;/P&gt;

&lt;P&gt;Actually, there is another field called displayname - which actually shows the first name and last name of that particular emails returning in above query - which is the actual field which I want to show in the dropdown - so that any person can look for the usernames instead of their email-ids. If I use this above query, it will show &lt;A href="mailto:1111@domain1.com"&gt;1111@domain1.com&lt;/A&gt;, &lt;A href="mailto:temp-personname@domain1.com"&gt;temp-personname@domain1.com&lt;/A&gt; and so on, but I want to show the Names of the employees in the dropdown. Please let me now how can i do that ? I mean how I can map the  field with the  field. Please help ? Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 18:11:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381589#M111600</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2018-12-28T18:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381590#M111601</link>
      <description>&lt;P&gt;One more thing in the search below, ^security is showing only small case, it is not showing - "Security" or "SECURITY" in the search, I mean it is case sensitive, how can I make it case insensitive, also can I use * sign instead of ^, so that I get all combinations of security keyword - "match(Login,"&lt;EM&gt;security&lt;/EM&gt;"),"yes","no"). Please help ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your base search
 | dedup Login
 | eval Is_User_Account=if(match(Login,"^\d{1,4}@") OR match(Login,"^temp-") OR match(Login,"^security"),"yes","no")
 | table Login,Is_User_Account
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Dec 2018 09:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381590#M111601</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2018-12-29T09:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381591#M111602</link>
      <description>&lt;P&gt;Hello @pgadhari,&lt;BR /&gt;
Check out this dashboard.&lt;BR /&gt;
lower() converts a string to lower case.&lt;BR /&gt;
match() is for matching a regex. The ^ refers to the start of the line. You could also use like() instead.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Users&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="displayname"&amp;gt;
      &amp;lt;label&amp;gt;displayname&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;prefix&amp;gt;displayname="&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;displayname&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;displayname&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=... source=... | stats count by displayname&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;$time.earliest$&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;$time.latest$&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="time" token="time"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=... source=... $displayname$
| eval Is_User_Account=if(match(Login,"^\d{1,4}@") OR match(lower(Login),"^temp-") OR match(lower(Login),"security"),"yes","no")
| table Login,displayname,Is_User_Account
| sort Login&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$time.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$time.latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Dec 2018 17:37:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381591#M111602</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2018-12-31T17:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381592#M111603</link>
      <description>&lt;P&gt;You need to create a &lt;CODE&gt;users.csv&lt;/CODE&gt; or a &lt;CODE&gt;serviceaccounts.csv&lt;/CODE&gt; file and create a &lt;CODE&gt;lookup table&lt;/CODE&gt; with it.  Then you can do a search like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=YouShouldAlwaysSpecifyAnIndex AND sourcetype=AndSourcetypeToo AND NOT (|inputlookup serviceaccounts.csv | table Login)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Jan 2019 22:10:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381592#M111603</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-01T22:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381593#M111604</link>
      <description>&lt;P&gt;hi @pgadhari,&lt;/P&gt;

&lt;P&gt;Did you get a chance to try @woodcock 's solution? If it worked, please resolve this post by approving it! If your problem is still not solved, keep us updated so that someone else can help ya. &lt;/P&gt;

&lt;P&gt;Thanks for posting!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 21:34:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381593#M111604</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2019-01-07T21:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381594#M111605</link>
      <description>&lt;P&gt;Actually creating users.csv and serviceaccounts.csv will be tedious task for me, as these are employees and consultants which is a long list. Hence, this solution does not fit my requirements. But thank you @woodcock for your valuable inputs.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 06:10:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381594#M111605</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2019-01-09T06:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter different values from the same field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381595#M111606</link>
      <description>&lt;P&gt;But still, I will upvote @woodcock solution, as for someone that will be definitely helpful. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 06:13:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-different-values-from-the-same-field/m-p/381595#M111606</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2019-01-09T06:13:05Z</dc:date>
    </item>
  </channel>
</rss>

