<?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 change a name within a field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343093#M101624</link>
    <description>&lt;P&gt;@happysplunkyay... Can you add some samples of filenames you have got? Do you have this filename as a field? if not you would need to provide a sample event. Also why you need to search for evbd and convert only EVB to upper case?&lt;/P&gt;

&lt;P&gt;If your field containing file name is &lt;STRONG&gt;filename&lt;/STRONG&gt;, then following should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;  filename=CASE("evbd*")
| eval filename=replace(filename,"evb","EVB")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 22 Apr 2017 03:13:18 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-04-22T03:13:18Z</dc:date>
    <item>
      <title>How to change a name within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343085#M101616</link>
      <description>&lt;P&gt;I have hundreds of .tmp files that begin with &lt;CODE&gt;evb*&lt;/CODE&gt; and exist within the "File Name" field. All I want to do is change all of their names to EVB. I've tried match, eval, rename, banging my head against the wall, and staring at my screen wishing it to happen. I'm sure it's something simple, but i'm missing it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval file=case("File Name"="evbd*","EVB") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please help!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 17:49:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343085#M101616</guid>
      <dc:creator>happysplunkyay</dc:creator>
      <dc:date>2017-04-21T17:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a name within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343086#M101617</link>
      <description>&lt;P&gt;The eval command doesn't support the wildcards that you use in base search. Instead use comparison functions e.g. &lt;CODE&gt;like&lt;/CODE&gt; or &lt;CODE&gt;match&lt;/CODE&gt;, like this. Also, in right side of eval/where, the field name should be enclosed in single quotes. With double quotes they are treated as literal string, not field:&lt;BR /&gt;
&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval file=case(like('File Name',"evbd%"),"EVB",'File Name') 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval file=case(match('File Name',"evbd"),"EVB",'File Name') 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also added default value for file should be same as "File Name" if it doesn't match your condition.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 18:22:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343086#M101617</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-21T18:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a name within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343087#M101618</link>
      <description>&lt;P&gt;try single commas, answer here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/54359/eval-function-on-a-column-that-has-spaces.html"&gt;https://answers.splunk.com/answers/54359/eval-function-on-a-column-that-has-spaces.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;eval file=case('File Name'="evbd*","EVB") &lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 18:23:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343087#M101618</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-04-21T18:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a name within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343088#M101619</link>
      <description>&lt;P&gt;eval file=case(match('File Name',"evb*","EVB",'File Name'))  |table file &lt;BR /&gt;
gives me the error "Error in 'eval' command: The arguments to the 'match' function are invalid."&lt;/P&gt;

&lt;P&gt;eval file=case(like('File Name',"evb*","EVB",'File Name')) |table file&lt;BR /&gt;
just straight up says "The search job has failed due to an error."&lt;/P&gt;

&lt;P&gt;I don't understand why it has to be this way - WHY OH WHY!?!?!?! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks for your time, sir.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 18:37:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343088#M101619</guid>
      <dc:creator>happysplunkyay</dc:creator>
      <dc:date>2017-04-21T18:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a name within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343089#M101620</link>
      <description>&lt;P&gt;the single quotes is definitely something I had wrong. As somesoni2 below stated, it's the wildcard * that eval doesn't get along with...&lt;/P&gt;

&lt;P&gt;thanks for your time.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 18:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343089#M101620</guid>
      <dc:creator>happysplunkyay</dc:creator>
      <dc:date>2017-04-21T18:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a name within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343090#M101621</link>
      <description>&lt;P&gt;Silly me. Missed position of brackets. Try the updated answer now.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 19:13:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343090#M101621</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-21T19:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a name within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343091#M101622</link>
      <description>&lt;P&gt;I would LOVE to say that did it, but the changing of the parenthetical position didn't do the trick. It seems like this would be so easy. Thanks again for your time.&lt;/P&gt;

&lt;P&gt;|eval file=case(match('File Name',"evb*"),"EVB",'File Name') |table file&lt;BR /&gt;
"Error in 'eval' command: The arguments to the 'case' function are invalid."&lt;/P&gt;

&lt;P&gt;| eval file=case(like('File Name',"evb%"),"EVB",'File Name')  |table file&lt;BR /&gt;
"The search job has failed due to an error"&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 19:24:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343091#M101622</guid>
      <dc:creator>happysplunkyay</dc:creator>
      <dc:date>2017-04-21T19:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a name within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343092#M101623</link>
      <description>&lt;P&gt;Try replace commond! &lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2017 02:42:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343092#M101623</guid>
      <dc:creator>puneethgowda</dc:creator>
      <dc:date>2017-04-22T02:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a name within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343093#M101624</link>
      <description>&lt;P&gt;@happysplunkyay... Can you add some samples of filenames you have got? Do you have this filename as a field? if not you would need to provide a sample event. Also why you need to search for evbd and convert only EVB to upper case?&lt;/P&gt;

&lt;P&gt;If your field containing file name is &lt;STRONG&gt;filename&lt;/STRONG&gt;, then following should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;  filename=CASE("evbd*")
| eval filename=replace(filename,"evb","EVB")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Apr 2017 03:13:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-name-within-a-field/m-p/343093#M101624</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-04-22T03:13:18Z</dc:date>
    </item>
  </channel>
</rss>

