<?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 one represent different values for a single extracted field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-one-represent-different-values-for-a-single-extracted/m-p/463534#M130673</link>
    <description>&lt;P&gt;Sorry I'm late getting back to you! This did send me in the right direction! I ended up using Eval with a case to classify the aliases that I was seeing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval AliasType = case(
    match(Alias, "AC*") AND len(Alias) &amp;gt;= 10,"Class1",
    len(Alias) == 6 AND isnum(Alias), "Class2",
    match(Alias, "NE*"), "Class3",
    len(Alias) == 12 AND isnum(Alias), "Class4,
    !isnum(Alias) OR len(Alias) != 12 OR len(Alias) != 6, "Class5"
    )
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Nov 2019 14:41:53 GMT</pubDate>
    <dc:creator>cb046891</dc:creator>
    <dc:date>2019-11-12T14:41:53Z</dc:date>
    <item>
      <title>How can one represent different values for a single extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-one-represent-different-values-for-a-single-extracted/m-p/463532#M130671</link>
      <description>&lt;P&gt;This issue comes from the error logs of a login service. When a user scans their badge and attempts to log in with an invalid alias the resulting service exception will contain the following example text: "Unable to lookup personnel with barcode: 554067 and orgId: 1217864."&lt;/P&gt;

&lt;P&gt;I've created a report to extract these events, it's a simple search containing "| rex field=_raw "barcode: (?&amp;lt; Alias&amp;gt;.&lt;EM&gt;) and orgId: (?&amp;lt; OrgID&amp;gt;.&lt;/EM&gt;)."" &lt;/P&gt;

&lt;P&gt;This will generate the fields "Alias" and "OrgID." Valid aliases should be a 6 digit number. However, due to users scanning the wrong barcode, we see values of Alias like AC000000000000, NE000000 or sometimes a 6 letter alpha string. Is there any way for me to represent the count/percentage of invalid values of Alias? Ideally I'd want to create a graphical representation of this with a Pie Chart.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Oct 2019 16:32:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-one-represent-different-values-for-a-single-extracted/m-p/463532#M130671</guid>
      <dc:creator>cb046891</dc:creator>
      <dc:date>2019-10-20T16:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can one represent different values for a single extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-one-represent-different-values-for-a-single-extracted/m-p/463533#M130672</link>
      <description>&lt;P&gt;Perhaps this will get you started.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | | rex "barcode: (?&amp;lt;Alias&amp;gt;\S+) and orgId: (?&amp;lt;OrgID&amp;gt;[^\.]+)"
| eval is_valid = if(len(Alias) == 6 AND isnum(Alias), 1, 0)
| stats count(eval(is_valid==1)) as Valid, count(eval(is_valid==0)) as Invalid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 20 Oct 2019 22:51:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-one-represent-different-values-for-a-single-extracted/m-p/463533#M130672</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-10-20T22:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can one represent different values for a single extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-one-represent-different-values-for-a-single-extracted/m-p/463534#M130673</link>
      <description>&lt;P&gt;Sorry I'm late getting back to you! This did send me in the right direction! I ended up using Eval with a case to classify the aliases that I was seeing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval AliasType = case(
    match(Alias, "AC*") AND len(Alias) &amp;gt;= 10,"Class1",
    len(Alias) == 6 AND isnum(Alias), "Class2",
    match(Alias, "NE*"), "Class3",
    len(Alias) == 12 AND isnum(Alias), "Class4,
    !isnum(Alias) OR len(Alias) != 12 OR len(Alias) != 6, "Class5"
    )
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Nov 2019 14:41:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-one-represent-different-values-for-a-single-extracted/m-p/463534#M130673</guid>
      <dc:creator>cb046891</dc:creator>
      <dc:date>2019-11-12T14:41:53Z</dc:date>
    </item>
  </channel>
</rss>

