<?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 display two field values in a single table column? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138433#M37991</link>
    <description>&lt;P&gt;Sorry, no, same result as before. It works only with transactionIncome or transactionOutcome, never both at the same time...&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jul 2015 20:07:57 GMT</pubDate>
    <dc:creator>JohnSwansson</dc:creator>
    <dc:date>2015-07-27T20:07:57Z</dc:date>
    <item>
      <title>How to display two field values in a single table column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138426#M37984</link>
      <description>&lt;P&gt;I have the following search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cashflow host=atm source=income OR source=outcome | eval accountStatus="Income: " + transactionIncome + " and Outcome: " + transactionOutcome | table accountStatus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have validated that &lt;CODE&gt;| table transactionIncome transactionOutcome&lt;/CODE&gt; works, meaning that I see the values of each field in separate columns, but it does not work combining them in a single column called accountStatus as the query would. Why is this? I am also not able to do a column with the sum of [ transactionIncome + transactionOutcome ]. What have I not understood? &lt;/P&gt;

&lt;P&gt;EDIT: Okay so apparently you can't add the value of a field from one event with the value of a field in another event. How would one go about this? transactionIncome and transactionOutcome are generated from different sources and are not within the same event.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 08:04:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138426#M37984</guid>
      <dc:creator>JohnSwansson</dc:creator>
      <dc:date>2015-07-27T08:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to display two field values in a single table column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138427#M37985</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You can add the columns using "addcoltotals" and "addtotals" commands.&lt;/P&gt;

&lt;P&gt;Also I tried with below and it is working fine for me. In my example code and bytes are two different fields.&lt;/P&gt;

&lt;P&gt;sourcetype=* | eval x= code + bytes | table code bytes x | fieldformat x= "Total:".x&lt;/P&gt;

&lt;P&gt;-Krishna Rajapantula&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 13:57:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138427#M37985</guid>
      <dc:creator>krishnarajapant</dc:creator>
      <dc:date>2015-07-27T13:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to display two field values in a single table column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138428#M37986</link>
      <description>&lt;P&gt;Concatenation operator between two strings in splunk is . and not +&lt;/P&gt;

&lt;PRE&gt;
 index=cashflow host=atm source=income OR source=outcome | eval accountStatus="Income: ".transactionIncome." and Outcome: ".transactionOutcome | table accountStatus
&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jul 2015 14:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138428#M37986</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2015-07-27T14:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to display two field values in a single table column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138429#M37987</link>
      <description>&lt;P&gt;Still doesn't work, when running &lt;CODE&gt;eval accountStatus="Income: ".transactionIncome." and Outcome: ".transactionOutcome&lt;/CODE&gt; i get:&lt;/P&gt;

&lt;P&gt;Nothing. accountStatus is empty. &lt;/P&gt;

&lt;P&gt;When running: &lt;CODE&gt;eval accountStatus="Income: ".transactionIncome&lt;/CODE&gt; I get:&lt;/P&gt;

&lt;P&gt;Income: 100&lt;/P&gt;

&lt;P&gt;When running &lt;CODE&gt;eval accountStatus=" and Outcome: ".transactionOutcome&lt;/CODE&gt; I get:&lt;/P&gt;

&lt;P&gt;and Outcome: 200&lt;/P&gt;

&lt;P&gt;... but within the same row and within the same "string of text" it will not show up. &lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 14:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138429#M37987</guid>
      <dc:creator>JohnSwansson</dc:creator>
      <dc:date>2015-07-27T14:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to display two field values in a single table column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138430#M37988</link>
      <description>&lt;P&gt;Do you have any common field/value that can be used to combine two events?? OR if they always appear in a particular order which can be used?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 14:52:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138430#M37988</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-07-27T14:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to display two field values in a single table column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138431#M37989</link>
      <description>&lt;P&gt;They both share the same host!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 15:19:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138431#M37989</guid>
      <dc:creator>JohnSwansson</dc:creator>
      <dc:date>2015-07-27T15:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to display two field values in a single table column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138432#M37990</link>
      <description>&lt;P&gt;If you query gives you only two events, one with transactionIncome and other with transactionOutcome, then try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cashflow host=atm source=income OR source=outcome | stats values(transactionIncome) as transactionIncome values(transactionOutcome) as transactionOutcome by host | eval accountStatus="Income: " + transactionIncome + " and Outcome: " + transactionOutcome | table accountStatus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;&lt;BR /&gt;
Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=cashflow host=atm source=income OR source=outcome | eval transactionIncome=coalesce(transactionIncome,null()) | eval transactionOutcome=coalesce(transactionOutcome,null())| stats values(transactionIncome) as transactionIncome values(transactionOutcome) as transactionOutcome by host | eval accountStatus="Income: " + transactionIncome + " and Outcome: " + transactionOutcome | table accountStatus
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jul 2015 19:23:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138432#M37990</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-07-27T19:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to display two field values in a single table column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138433#M37991</link>
      <description>&lt;P&gt;Sorry, no, same result as before. It works only with transactionIncome or transactionOutcome, never both at the same time...&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 20:07:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-two-field-values-in-a-single-table-column/m-p/138433#M37991</guid>
      <dc:creator>JohnSwansson</dc:creator>
      <dc:date>2015-07-27T20:07:57Z</dc:date>
    </item>
  </channel>
</rss>

