<?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: Label User IDs based on name in #Random</title>
    <link>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/668560#M1941</link>
    <description>&lt;P&gt;Thank you for your help.&amp;nbsp; You got me on the right track.&amp;nbsp; While searching using that command I found another way to get what I was looking for by using the search command which I could then use wildcards to filter out what I need or don't need.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gave me all Windows devices:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;|search Device=*DESKTOP* OR *laptop* OR *lenovo* OR *dell* OR *HP*| stats dc("IONS") as total_users&lt;/LI-CODE&gt;
&lt;P&gt;This listed all devices besides what I was looking for:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| search NOT Device IN (*LAPTOP*,*Desktop*,*lenovo*,*dell*,*HP*,*MAC*,*Ipad*,)
| stats dc("IONS") as total_users&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2023 15:03:26 GMT</pubDate>
    <dc:creator>Madmax</dc:creator>
    <dc:date>2023-11-14T15:03:26Z</dc:date>
    <item>
      <title>Label User IDs based on name</title>
      <link>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/667739#M1937</link>
      <description>&lt;P&gt;index=gbts-vconnection * onEvent DISCONNECTED (host=Host1)&lt;BR /&gt;| rex field=_raw "(?ms)^(?:[^:\\n]*:){5}(?P&amp;lt;IONS&amp;gt;[^;]+)(?:[^:\\n]*:){8}(?P&amp;lt;Device&amp;gt;[^;]+)(?:[^;\\n]*;){4}\\w+:(?P&amp;lt;VDI&amp;gt;\\w+)" offset_field=_extracted_fields_bounds&lt;/P&gt;&lt;P&gt;This lists all Devices that have disconnected.&amp;nbsp; I'm trying to create a chart that lists only Macs, or Windows based on a key word like "mac" or "laptop"&amp;nbsp; in the Device name.&amp;nbsp; I tried using eval command but can't seem to get it working.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 19:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/667739#M1937</guid>
      <dc:creator>Madmax</dc:creator>
      <dc:date>2023-11-07T19:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Label User IDs based on name</title>
      <link>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/667741#M1938</link>
      <description>&lt;P&gt;What exactly did you try with the &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; command?&amp;nbsp; How did the results not meet expectations?&lt;/P&gt;&lt;P&gt;To properly assist with a regex-related question, we need to see some example (sanitized) data.&amp;nbsp; Have you confirmed the regular expression works on regex101.com?&amp;nbsp; The "\\w+" constructs look like they should be something else (probably "\w+").&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 20:21:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/667741#M1938</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-11-07T20:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Label User IDs based on name</title>
      <link>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/667744#M1939</link>
      <description>&lt;P&gt;Yes it absolutely has data.&amp;nbsp; I already have a full dashboard with disconnect data based on (IONS) User IDs, and Device names.&amp;nbsp; I am just stuck on this request to be able to filter the data by device type using keywords.&amp;nbsp; I don't think the eval command accepts wildcards like *mac* which I need.&amp;nbsp; Some Device names are for example "John-mac" others are "laptop-Mary", etc.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get data using the following:&lt;/P&gt;&lt;P&gt;| stats count by "User ID"&lt;/P&gt;&lt;P&gt;| sort -count&lt;/P&gt;&lt;P&gt;but when I try using eval below it gives me nothing.&amp;nbsp; I can confirm that there is a Device named IPAD, Perhaps I should use another command but I'm fairly new at this.&amp;nbsp; Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;|eval DeviceType=case(Device=IPAD, "Macs", Device=Laptop, "Windows")&lt;BR /&gt;|stats count by Device, DeviceType&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 21:04:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/667744#M1939</guid>
      <dc:creator>Madmax</dc:creator>
      <dc:date>2023-11-07T21:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Label User IDs based on name</title>
      <link>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/667747#M1940</link>
      <description>&lt;P&gt;Again, without seeing sample data it's very difficult to determine why the search is not matching the data.&lt;/P&gt;&lt;P&gt;Try using quotes in the &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; command&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|eval DeviceType=case(Device="IPAD", "Macs", Device="Laptop", "Windows")&lt;/LI-CODE&gt;&lt;P&gt;or use the &lt;FONT face="courier new,courier"&gt;match&lt;/FONT&gt; function to match an embedded string&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|eval DeviceType=case(match(Device, "IPAD"), "Macs", match(Device, "Laptop"), "Windows")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 21:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/667747#M1940</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-11-07T21:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Label User IDs based on name</title>
      <link>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/668560#M1941</link>
      <description>&lt;P&gt;Thank you for your help.&amp;nbsp; You got me on the right track.&amp;nbsp; While searching using that command I found another way to get what I was looking for by using the search command which I could then use wildcards to filter out what I need or don't need.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gave me all Windows devices:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;|search Device=*DESKTOP* OR *laptop* OR *lenovo* OR *dell* OR *HP*| stats dc("IONS") as total_users&lt;/LI-CODE&gt;
&lt;P&gt;This listed all devices besides what I was looking for:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| search NOT Device IN (*LAPTOP*,*Desktop*,*lenovo*,*dell*,*HP*,*MAC*,*Ipad*,)
| stats dc("IONS") as total_users&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 15:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Random/Label-User-IDs-based-on-name/m-p/668560#M1941</guid>
      <dc:creator>Madmax</dc:creator>
      <dc:date>2023-11-14T15:03:26Z</dc:date>
    </item>
  </channel>
</rss>

