<?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 get 3 different outputs in a single column in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168460#M48044</link>
    <description>&lt;P&gt;hey I got it &lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Tue, 23 Dec 2014 12:48:53 GMT</pubDate>
    <dc:creator>Laya123</dc:creator>
    <dc:date>2014-12-23T12:48:53Z</dc:date>
    <item>
      <title>How to get 3 different outputs in a single column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168452#M48036</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want 3 different outputs in a single column.&lt;/P&gt;

&lt;P&gt;I will explain what exactly I want to do&lt;/P&gt;

&lt;P&gt;I have activated a project in live, i want to know the whether the project is activated or not to get this output i have used the following query and I am getting result but the project status is coming in 3 different columns instead of that i want output in a single column with project status.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Query:&lt;/STRONG&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ibm sourcetype=act host=KO*MRI65* OR host=KO*MRI75* | rex field=_raw ".*.*ACT,(?[0-9]+ - [0-9|a-z|A-Z]+),.*" | rex field=_raw ".*ERROR: (?.*)"  | eval Tier=if(match(host,"KO...MRI65."), "Launch", "Publish") | transaction activationID maxevents=10000 startswith="RemoteActivateServer START"  | stats eval(match(_raw,"Connecting to DPM")) as Queued, eval(match(_raw,"Project .* activated")) as Activated, eval(match(_raw, "Activate failed")) as Failed by activationID  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;after using the above query I am getting results like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;activationID         InQueue           Activate               Failed           
ABCDEFF                    0                1                   0
cdtskl                     1                0                   0
ugsjkc                     0                1                   0
jktful                     0                0                   1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want your help in, is it possible to put these three columns in one columns as 'ProjectStatus' instead of 3 columns&lt;/P&gt;

&lt;P&gt;I want out put like;&lt;/P&gt;

&lt;P&gt;activationID         ProjectStatus&lt;BR /&gt;&lt;BR /&gt;
ABCDEFF                    Activate&lt;BR /&gt;&lt;BR /&gt;
cdtskl                          Queue&lt;BR /&gt;&lt;BR /&gt;
ugsjkc                          Activate&lt;BR /&gt;&lt;BR /&gt;
jktful                            Failed                &lt;/P&gt;

&lt;P&gt;Please help me to do this&lt;/P&gt;

&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 09:30:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168452#M48036</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2014-12-22T09:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different outputs in a single column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168453#M48037</link>
      <description>&lt;P&gt;Hi Laya123,&lt;/P&gt;

&lt;P&gt;try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ibm sourcetype=act host=KO*MRI65* OR host=KO*MRI75* 
| rex field=_raw ".*.*ACT,(?[0-9]+ - [0-9|a-z|A-Z]+),.*" | rex field=_raw ".*ERROR: (?.*)"  
| eval Tier=if(match(host,"KO...MRI65."), "Launch", "Publish") 
| transaction activationID maxevents=10000 startswith="RemoteActivateServer START"  
| eval ProjectStatus=case(match(_raw,"Connecting to DPM") , "Queued" , match(_raw,"Project .* activated"), "Activated" , match(_raw, "Activate failed"), "Failed")
| table activationID ProjectStatus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This was not tested - now it is. Still, maybe you need to adapt it to your needs; but it should get you started ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 11:06:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168453#M48037</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-12-22T11:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different outputs in a single column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168454#M48038</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thank  you so much for your immediate response,&lt;/P&gt;

&lt;P&gt;But after executing that query I am getting this error&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Error in 'eval' command: The operator at ', "Queued" , match(_raw,"Project .* activated"), "Activated" , match(_raw, "Activate failed"), "Failed")' is invalid.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Query is: &lt;EM&gt;index=ibm sourcetype=act host=KO*MRI65&lt;/EM&gt; OR host=KO*MRI75* | rex field=_raw ".&lt;EM&gt;.*ACT,(?[0-9]+ - [0-9|a-z|A-Z]+),.&lt;/EM&gt;" | rex field=_raw ".&lt;EM&gt;ERROR: (?.&lt;/EM&gt;)"  | eval Tier=if(match(host,"KO...MRI65."), "Launch", "Publish") | transaction activationID maxevents=10000 startswith="RemoteActivateServer START"  | eval ProjectStatus=case(match(_raw,"Connecting to DPM")) , "Queued" , match(_raw,"Project .* activated"), "Activated" , match(_raw, "Activate failed"), "Failed") | stats ProjectStatus by activationID*&lt;/P&gt;

&lt;P&gt;Please help me&lt;/P&gt;

&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:29:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168454#M48038</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2020-09-28T18:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different outputs in a single column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168455#M48039</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thank  you so much for your immediate response,&lt;/P&gt;

&lt;P&gt;But after executing that query I am getting this error&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Error in 'eval' command: The operator at ', "Queued" , match(_raw,"Project .* activated"), "Activated" , match(_raw, "Activate failed"), "Failed")' is invalid.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Query is: &lt;EM&gt;index=ibm sourcetype=act host=KO*MRI65&lt;/EM&gt; OR host=KO*MRI75* | rex field=_raw ".&lt;EM&gt;.*ACT,(?[0-9]+ - [0-9|a-z|A-Z]+),.&lt;/EM&gt;" | rex field=_raw ".&lt;EM&gt;ERROR: (?.&lt;/EM&gt;)"  | eval Tier=if(match(host,"KO...MRI65."), "Launch", "Publish") | transaction activationID maxevents=10000 startswith="RemoteActivateServer START"  | eval ProjectStatus=case(match(_raw,"Connecting to DPM")) , "Queued" , match(_raw,"Project .* activated"), "Activated" , match(_raw, "Activate failed"), "Failed") | stats ProjectStatus by activationID*&lt;/P&gt;

&lt;P&gt;Please help me&lt;/P&gt;

&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:32:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168455#M48039</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2020-09-28T18:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different outputs in a single column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168456#M48040</link>
      <description>&lt;P&gt;The double closing parentheses after &lt;CODE&gt;match(_raw,"Connecting to DPM"))&lt;/CODE&gt; should only be a single closing parenthesis.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 12:59:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168456#M48040</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-12-22T12:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different outputs in a single column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168457#M48041</link>
      <description>&lt;P&gt;Like I said &lt;CODE&gt;it was not tested&lt;/CODE&gt; and maybe you need to adapt it.....so, now it is tested - see my updated answer&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 13:04:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168457#M48041</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-12-22T13:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different outputs in a single column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168458#M48042</link>
      <description>&lt;P&gt;update ping....&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 13:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168458#M48042</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-12-22T13:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different outputs in a single column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168459#M48043</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thank you so much for your response it is working,&lt;/P&gt;

&lt;P&gt;I need some more help in the same query. I am trying to get some other results along with that output, so I have added few lines, to that query which you shared but I am getting error - &lt;EM&gt;Error in 'eval' command: The operator at ', values(ErrorMsg) as Error, values(duration) as Duration, latest(_time) as LastActivation, values(Project) as Project, values(Tier) as Tier' is invalid.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Query -&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index=ibm sourcetype=act host=A*MRI65* OR host=A*MRI75* | rex field=_raw ".&lt;EM&gt;.*ACT,(?[0-9]+ - [0-9|a-z|A-Z]+),.&lt;/EM&gt;" | rex field=_raw ".&lt;EM&gt;ERROR: (?.&lt;/EM&gt;)"  | eval Tier=if(match(host,"A...MRI65."), "L", "P") | transaction activationID maxevents=10000 startswith="RemoteActivateServer START",  | eval ProjectStatus=case(match(_raw,"Project .* activated"), "Activated" , match(_raw, "Activate failed"), "Failed", 1=1, "QUEUE")*,   values(ErrorMsg) as Error, values(duration) as Duration, latest(_time) as LastActivation, values(Project) as Project, values(Tier) as Tier | table activationID ProjectStatus | sort LastActivation desc | eval Duration = round(Duration) | eval Queued=Queued-Activated-Failed | rename Duration to "Duration in Seconds" | eval LastActivation = strftime(LastActivation,"%A %b %d %I:%M %P") | rename LastActivation to "Last Activation" | rename Queued to "In Queue / Processing"&lt;/STRONG&gt;*&lt;/P&gt;

&lt;P&gt;Herewith I am enclosing my previous query  and output which i got, &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Query&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;index=ibm sourcetype=act host=A*MRI65* OR host=A*MRI75* | rex field=_raw ".&lt;EM&gt;.*ACT,(?[0-9]+ - [0-9|a-z|A-Z]+),.&lt;/EM&gt;" | rex field=_raw ".&lt;EM&gt;ERROR: (?.&lt;/EM&gt;)"  | eval Tier=if(match(host,"A...MRI65."), "L", "P") | transaction activationID maxevents=10000 startswith="RemoteActivateServer START"  | stats count(eval(match(_raw,"Connecting to DPM"))) as Queued, count(eval(match(_raw,"Project .* activated"))) as Activated, count(eval(match(_raw, "Activate failed"))) as Failed, values(ErrorMsg) as Error, values(duration) as Duration, latest(_time) as LastActivation, values(Project) as Project, values(Tier) as Tier by activationID | sort LastActivation desc | eval Duration = round(Duration) | eval Queued=Queued-Activated-Failed | rename Duration to "Duration in Seconds" | eval LastActivation = strftime(LastActivation,"%A %b %d %I:%M %P") | rename LastActivation to "Last Activation" | rename Queued to "In Queue / Processing"&lt;/P&gt;

&lt;P&gt;the output is coming like this&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;activationID         &lt;STRONG&gt;InQueue           Activate            Failed&lt;/STRONG&gt;        Error           Druation in Sec        Last activation     Project      Tier&lt;BR /&gt;&lt;BR /&gt;
 ABCDEFF                    0                       1                        0                                            2                              24thSep             abc               L&lt;BR /&gt;
 cdtskl                          1                      0                         0                                            5                              20thoct              edf                P&lt;BR /&gt;
 ugsjkc                         0                      1                         0&lt;BR /&gt;
 jktful                           0                       0                        1&lt;/P&gt;

&lt;P&gt;but i want project status which is bold in the output in one column as i said yesterday along with other results&lt;/P&gt;

&lt;P&gt;Can you help me in this&lt;/P&gt;

&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168459#M48043</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2020-09-28T18:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different outputs in a single column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168460#M48044</link>
      <description>&lt;P&gt;hey I got it &lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2014 12:48:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-outputs-in-a-single-column/m-p/168460#M48044</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2014-12-23T12:48:53Z</dc:date>
    </item>
  </channel>
</rss>

