<?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: Merging with similar strings without eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484976#M140330</link>
    <description>&lt;P&gt;thanks @kamlesh_vaghela, I like how you used regex here. But what if I have a new error that has string like "Low ink on printer A and needs cartridge replacement", the outcome I'm expecting is "Low ink on printer * and needs cartridge replacement"? Would there be better way for this?&lt;/P&gt;</description>
    <pubDate>Fri, 01 May 2020 15:53:02 GMT</pubDate>
    <dc:creator>chiilii</dc:creator>
    <dc:date>2020-05-01T15:53:02Z</dc:date>
    <item>
      <title>Merging with similar strings without eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484972#M140326</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I would like to combine similar strings (with different field values) in my data.&lt;/P&gt;
&lt;P&gt;The data I have now:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Error | Count (yesterday) | Count (today)
Low ink on printer A | 10 | 0
Invalid input on line 1 | 5 | 2
Invalid input on line 2 | 4 | 4
Low ink on printer B | 6 | 3
Service crash on App1 | 1 | 0
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What I want to have:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Error Type | Count (yesterday) | Count (today)
Low ink on printer * | 16 | 3
Invalid input on line * | 9 | 6
Service crash on * | 1 | 0
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; I may have thousands of error type that needs to be combined. &lt;BR /&gt;Is it possible to achieve without having to &lt;CODE&gt;eval&lt;/CODE&gt; every string?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2020 23:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484972#M140326</guid>
      <dc:creator>chiilii</dc:creator>
      <dc:date>2020-06-06T23:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Merging with similar strings without eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484973#M140327</link>
      <description>&lt;P&gt;&lt;EM&gt;Error&lt;/EM&gt; is &lt;CODE&gt;digit&lt;/CODE&gt; + &lt;CODE&gt;type description&lt;/CODE&gt; ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 05:12:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484973#M140327</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-30T05:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Merging with similar strings without eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484974#M140328</link>
      <description>&lt;P&gt;@chiilii &lt;/P&gt;

&lt;P&gt;Can you please try this ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH 
| rex field=Error mode=sed "s/\s(?&amp;lt;last&amp;gt;\w+)$/ * /g" max_match=0
| rex field=Error mode=sed "s/^(\d)\.\s//g" max_match=0
| stats sum("Count (yesterday)") as "Count (yesterday)" sum("Count (today)") as "Count (today)" by Error
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Sample Search:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw=" Error Count (yesterday)   Count (today)
1. Low ink on printer A 10  0
2. Invalid input on line 1  5   2
3. Invalid input on line 2  4   4
4. Low ink on printer B 6   3
5. Service crash on App1    1   0" 
| multikv forceheader=1 
| rename Count__yesterday_ as "Count (yesterday)", Count__today_ as "Count (today)" 
| table Error "Count (yesterday)" "Count (today)" 
| rename comments as "this is for sample data only" 
| rex field=Error mode=sed "s/\s(?&amp;lt;last&amp;gt;\w+)$/ * /g" max_match=0
| rex field=Error mode=sed "s/^(\d)\.\s//g" max_match=0
| stats sum("Count (yesterday)") as "Count (yesterday)" sum("Count (today)") as "Count (today)" by Error
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 05:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484974#M140328</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-04-30T05:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Merging with similar strings without eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484975#M140329</link>
      <description>&lt;P&gt;@to4kawa  sorry for the confusion, removed the digit&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 14:47:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484975#M140329</guid>
      <dc:creator>chiilii</dc:creator>
      <dc:date>2020-05-01T14:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Merging with similar strings without eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484976#M140330</link>
      <description>&lt;P&gt;thanks @kamlesh_vaghela, I like how you used regex here. But what if I have a new error that has string like "Low ink on printer A and needs cartridge replacement", the outcome I'm expecting is "Low ink on printer * and needs cartridge replacement"? Would there be better way for this?&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 15:53:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484976#M140330</guid>
      <dc:creator>chiilii</dc:creator>
      <dc:date>2020-05-01T15:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Merging with similar strings without eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484977#M140331</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="Error,Count_yesterday,Count_today
Low ink on printer A , 10 , 0
Invalid input on line 1 , 5 , 2
Invalid input on line 2 , 4 , 4
Low ink on printer B , 6 , 3
Service crash on App1 , 1 , 0"
| rex mode=sed "s/(?m)^\s+//g" 
| multikv forceheader=1
| table E* C*
| rename COMMENT as "this is sample"

| rex field=Error mode=sed "s/^((?&amp;lt;Msg&amp;gt;.+)\s)\S+/\1*/"

| stats sum(Count_yesterday) as Count_yesterday sum(Count_today) as Count_today by Error
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;well, &lt;CODE&gt;do not use eval&lt;/CODE&gt; is hard.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 23:37:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/484977#M140331</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-01T23:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Merging with similar strings without eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/576735#M201006</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I love your solution, but any idea how my rex string should be if my difference is in the middle of the string?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error String Example 1:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;No exception occurred when displaying value for task=inspect entity.name=software propertyKey=keyNameForSomething. Please write a rule *&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No exception occurred when displaying value for task=inspect entity.name=software propertyKey=keyNameForSomethingElse. Please write a rule *&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No exception occurred when displaying value for task=inspect entity.name=software propertyKey=keyNameForSomethingElseElse. Please write a rule *&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error String Example 2&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Locale is null for the language, es with ec, com.EditingContext@1y3y1u3e. Skip this *&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Locale is null for the language, en with ec, com.ITEditingContext@2y5f3u3e. Skip this *&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 10:16:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-with-similar-strings-without-eval/m-p/576735#M201006</guid>
      <dc:creator>erica</dc:creator>
      <dc:date>2021-11-30T10:16:34Z</dc:date>
    </item>
  </channel>
</rss>

