<?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 How to add two field values into new field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-two-field-values-into-new-field/m-p/627502#M218049</link>
    <description>&lt;P&gt;I have a field A which has percentage values. Also, I have&amp;nbsp;a field B which has percentage values in it. Both are different values.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Now I want to create a new field which adds both the values.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;BR /&gt;&lt;BR /&gt;10%&amp;nbsp; &amp;nbsp; &amp;nbsp; 30%&lt;BR /&gt;&lt;BR /&gt;20%&amp;nbsp; &amp;nbsp; &amp;nbsp; 50%&lt;BR /&gt;&lt;BR /&gt;30%&amp;nbsp; &amp;nbsp; &amp;nbsp;70%&lt;BR /&gt;&lt;BR /&gt;The query should fetch me the results like below:&lt;BR /&gt;&lt;BR /&gt;C&lt;BR /&gt;&lt;BR /&gt;40%&lt;BR /&gt;&lt;BR /&gt;70%&lt;BR /&gt;&lt;BR /&gt;100%&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2023 05:54:34 GMT</pubDate>
    <dc:creator>vinothkumark</dc:creator>
    <dc:date>2023-01-19T05:54:34Z</dc:date>
    <item>
      <title>How to add two field values into new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-two-field-values-into-new-field/m-p/627502#M218049</link>
      <description>&lt;P&gt;I have a field A which has percentage values. Also, I have&amp;nbsp;a field B which has percentage values in it. Both are different values.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Now I want to create a new field which adds both the values.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;BR /&gt;&lt;BR /&gt;10%&amp;nbsp; &amp;nbsp; &amp;nbsp; 30%&lt;BR /&gt;&lt;BR /&gt;20%&amp;nbsp; &amp;nbsp; &amp;nbsp; 50%&lt;BR /&gt;&lt;BR /&gt;30%&amp;nbsp; &amp;nbsp; &amp;nbsp;70%&lt;BR /&gt;&lt;BR /&gt;The query should fetch me the results like below:&lt;BR /&gt;&lt;BR /&gt;C&lt;BR /&gt;&lt;BR /&gt;40%&lt;BR /&gt;&lt;BR /&gt;70%&lt;BR /&gt;&lt;BR /&gt;100%&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 05:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-two-field-values-into-new-field/m-p/627502#M218049</guid>
      <dc:creator>vinothkumark</dc:creator>
      <dc:date>2023-01-19T05:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add two field values into new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-two-field-values-into-new-field/m-p/627522#M218053</link>
      <description>&lt;P&gt;This should work.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval A = "10%"
| eval B = "20%"
```The stuff above is just to get sone sample data```
| eval C = tonumber(replace(A,"\D","")) + tonumber(replace(B,"\D","")) . "%"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 Jan 2023 20:46:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-two-field-values-into-new-field/m-p/627522#M218053</guid>
      <dc:creator>fredclown</dc:creator>
      <dc:date>2023-01-18T20:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to add two field values into new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-two-field-values-into-new-field/m-p/627544#M218061</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/146503"&gt;@fredclown&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thanks&amp;nbsp;for input. It works.&amp;nbsp; Can you help on the query if the values are in decimal?&lt;BR /&gt;&lt;SPAN&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;10.5&amp;nbsp; &amp;nbsp; &amp;nbsp; 20.3&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;C&lt;BR /&gt;30.8&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 06:32:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-two-field-values-into-new-field/m-p/627544#M218061</guid>
      <dc:creator>vinothkumark</dc:creator>
      <dc:date>2023-01-19T06:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to add two field values into new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-two-field-values-into-new-field/m-p/627797#M218125</link>
      <description>&lt;P&gt;This should work with decimals and non-numeric characters.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval A = "10.5% sdfgdsfgjlk"
| eval B = "20.2% gdsfdf"
```The stuff above is just to get sone sample data```
| eval C = tonumber(replace(A,"[^0-9\.]+","")) + tonumber(replace(B,"[^0-9\.]+","")) . "%"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 17:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-two-field-values-into-new-field/m-p/627797#M218125</guid>
      <dc:creator>fredclown</dc:creator>
      <dc:date>2023-01-20T17:22:22Z</dc:date>
    </item>
  </channel>
</rss>

