<?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 combine two fields with eval ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488136#M193911</link>
    <description>&lt;P&gt;| search "body.refundTenderType"=* &lt;BR /&gt;
| search "body.refundTenders{}.paymentType"=* &lt;BR /&gt;
| rename body.refundTenderType as "RefundTender" &lt;BR /&gt;
| rename body.refundTenders{}.paymentType as "RefundTenderPaymentType" &lt;BR /&gt;
| stats count AS Count BY RefundTender RefundTenderPaymentType, body.orderNumber  &lt;CODE&gt;add this here&lt;/CODE&gt;&lt;BR /&gt;
| eval Refund = RefundTender . "-" . RefundTenderPaymentType &lt;BR /&gt;
| table Refund , body.orderNumber &lt;BR /&gt;
| chart count by Refund&lt;/P&gt;

&lt;P&gt;Try this if it works&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2019 13:22:48 GMT</pubDate>
    <dc:creator>siddharthkhatsu</dc:creator>
    <dc:date>2019-11-21T13:22:48Z</dc:date>
    <item>
      <title>How to combine two fields with eval ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488131#M193906</link>
      <description>&lt;P&gt;paymenttype                   RefunpaymentType&lt;/P&gt;

&lt;P&gt;DEBIT                                   DEBIT&lt;BR /&gt;
GIFTCARD                           PGIFTCARD&lt;BR /&gt;
ORIGINAL                           CREDITCARD&lt;BR /&gt;
ORIGINAL                           DEBITCARD&lt;/P&gt;

&lt;P&gt;I am trying to get output like this and also count of this combinations&lt;/P&gt;

&lt;P&gt;Refund                                       Count&lt;/P&gt;

&lt;P&gt;DEBIT-DEBIT                               100&lt;BR /&gt;
GIFTCARD -PGIFTCARD               50&lt;BR /&gt;
ORIGINAL-CREDITCARD              75&lt;BR /&gt;
ORIGINAL-DEBITCARD                88&lt;/P&gt;

&lt;P&gt;Can any one help&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 21:19:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488131#M193906</guid>
      <dc:creator>monipinni</dc:creator>
      <dc:date>2019-11-20T21:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two fields with eval ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488132#M193907</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  eval field=paymenttype+"-"+RefunpaymentType | stats count by field
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Nov 2019 21:30:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488132#M193907</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-11-20T21:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two fields with eval ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488133#M193908</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats count AS Count BY paymenttype RefunpaymentType
| eval Refund = paymenttype . "-" . RefunpaymentType
| table Refund Count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Nov 2019 22:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488133#M193908</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-20T22:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two fields with eval ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488134#M193909</link>
      <description>&lt;P&gt;@woodcock : tried this search i got results but count is displaying is 1 instead of accurate count values&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| search "body.refundTenderType"=* | search "body.refundTenders{}.paymentType"=* |  rename body.refundTenderType as "RefundTender" | rename body.refundTenders{}.paymentType as "RefundTenderPaymentType" | stats count AS Count BY RefundTender RefundTenderPaymentType | eval Refund = RefundTender . "-" . RefundTenderPaymentType | table Refund , body.orderNumber | chart count by Refund&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 02:35:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488134#M193909</guid>
      <dc:creator>monipinni</dc:creator>
      <dc:date>2019-11-21T02:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two fields with eval ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488135#M193910</link>
      <description>&lt;P&gt;1 extra step that is not in my answer; do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | search "body.refundTenderType"=* AND "body.refundTenders{}.paymentType"=* 
| rename body.refundTenderType as "RefundTender", body.refundTenders{}.paymentType as "RefundTenderPaymentType" 
| stats count AS Count BY RefundTender RefundTenderPaymentType 
| eval Refund = RefundTender . "-" . RefundTenderPaymentType 
| table Refund Count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Nov 2019 03:26:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488135#M193910</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-21T03:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two fields with eval ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488136#M193911</link>
      <description>&lt;P&gt;| search "body.refundTenderType"=* &lt;BR /&gt;
| search "body.refundTenders{}.paymentType"=* &lt;BR /&gt;
| rename body.refundTenderType as "RefundTender" &lt;BR /&gt;
| rename body.refundTenders{}.paymentType as "RefundTenderPaymentType" &lt;BR /&gt;
| stats count AS Count BY RefundTender RefundTenderPaymentType, body.orderNumber  &lt;CODE&gt;add this here&lt;/CODE&gt;&lt;BR /&gt;
| eval Refund = RefundTender . "-" . RefundTenderPaymentType &lt;BR /&gt;
| table Refund , body.orderNumber &lt;BR /&gt;
| chart count by Refund&lt;/P&gt;

&lt;P&gt;Try this if it works&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 13:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-fields-with-eval/m-p/488136#M193911</guid>
      <dc:creator>siddharthkhatsu</dc:creator>
      <dc:date>2019-11-21T13:22:48Z</dc:date>
    </item>
  </channel>
</rss>

