<?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 to retrieve names from comments and assign values to those names? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-names-from-comments-and-assign-values-to-those/m-p/439272#M124973</link>
    <description>&lt;P&gt;Hi @ramesh12345&lt;/P&gt;

&lt;P&gt;Try this rex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval comments="Case:1111 Worked persons: Raju,Ramu,rahul" 
| appendpipe 
    [| eval comments="Case:1112 Worked persons: Ramu,rahul"] 
| rex field=comments "Case:(?P&amp;lt;CaseNumber&amp;gt;.\d+).+\:\s(?P&amp;lt;Names&amp;gt;.+)$" 
| makemv delim="," Names 
| mvexpand Names 
| stats count by Names
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Mar 2019 13:58:05 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2019-03-13T13:58:05Z</dc:date>
    <item>
      <title>How to retrieve names from comments and assign values to those names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-names-from-comments-and-assign-values-to-those/m-p/439271#M124972</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We have closed cases and escalated cases,in that single person can work on particular case as well as multiple persons worked on particular case.So my requirement is to display in bar chart how many cases resolved and escalated by person.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Ex: Case:1111 Worked persons: Raju,Ramu,rahul
      Case:1112 Worked persons:  Ramu,rahul
      Case:1113 Worked persons: Raju      
      Case:1115 Worked persons: Ramu
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So my chart should be &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Raju count is 2
Ramu count is 2
rahul count is 1 like this
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Basic search is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="os" sourcetype="Service"  CaseNumber=* status=*  assignment_group=* |dedup _time,CaseNumber,assignment |streamstats current=f last(assignment) as lg, last(active) as  Active by CaseNumber|lookup test.csv check as assigned_to OUTPUT TeamName| eval is_escalated= if(assignment!=lg AND assignment="Sustaining",1,NULL) |eval is_resolved=if(assignment="Sustaining" AND status="Complete" AND (isnull(Active) OR Active="true"),1,NULL)|stats count(is_escalated) AS "Escalated Cases" count(is_resolved) AS "Resolved Cases"  assigned_to,TeamName| fields - TeamName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I retrieved the names from comments using below search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="os" sourcetype="Service" CaseNumber=*|dedup _time,CaseNumber,status|rex field=Comments"(?\w*\W*\w*\s*\w*\s*\s\(\d+\))" |stats values(Names) as Names by CaseNumber|nomv Names|table CaseNumber,Names,status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I want to display resolved and escalated cases by name.Please help how to do this.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 12:27:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-names-from-comments-and-assign-values-to-those/m-p/439271#M124972</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-03-13T12:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve names from comments and assign values to those names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-names-from-comments-and-assign-values-to-those/m-p/439272#M124973</link>
      <description>&lt;P&gt;Hi @ramesh12345&lt;/P&gt;

&lt;P&gt;Try this rex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval comments="Case:1111 Worked persons: Raju,Ramu,rahul" 
| appendpipe 
    [| eval comments="Case:1112 Worked persons: Ramu,rahul"] 
| rex field=comments "Case:(?P&amp;lt;CaseNumber&amp;gt;.\d+).+\:\s(?P&amp;lt;Names&amp;gt;.+)$" 
| makemv delim="," Names 
| mvexpand Names 
| stats count by Names
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2019 13:58:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-names-from-comments-and-assign-values-to-those/m-p/439272#M124973</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-13T13:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve names from comments and assign values to those names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-names-from-comments-and-assign-values-to-those/m-p/439273#M124974</link>
      <description>&lt;P&gt;Could you please send me the final query.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 14:11:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-names-from-comments-and-assign-values-to-those/m-p/439273#M124974</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-03-13T14:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve names from comments and assign values to those names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-names-from-comments-and-assign-values-to-those/m-p/439274#M124975</link>
      <description>&lt;P&gt;But my problem is whenever we write the condition eval is_resolved=if(assignment="Sustaining" AND status="Complete" AND (isnull(Active) OR Active="true"),1,NULL).it is showing only one person name.i want to assign that case to all who worked on that case.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 14:42:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-names-from-comments-and-assign-values-to-those/m-p/439274#M124975</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-03-13T14:42:07Z</dc:date>
    </item>
  </channel>
</rss>

