<?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: Splitting up data into multiple columns in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535102#M151239</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225210"&gt;@eb1929&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can count http_status codes separately like below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;host=XXX sourcetype=ZZZ http_status=500 OR http_status=502 "HighCostAPI"
| eval status_500=if(http_status==500,1,0)
| eval status_502=if(http_status==502,1,0)
| stats sum(status_500) as status_500 sum(status_502) as status_502 count by http_status, _time, pzInsKey
| fields http_status _time pzInsKey status_500 status_502 count
| addcoltotals status_500 status_502 count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you an upvote is appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jan 2021 20:29:28 GMT</pubDate>
    <dc:creator>scelikok</dc:creator>
    <dc:date>2021-01-07T20:29:28Z</dc:date>
    <item>
      <title>Splitting up data into multiple columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535096#M151237</link>
      <description>&lt;P&gt;Hello i am using the following search&amp;nbsp;&lt;/P&gt;&lt;P&gt;host=XXX sourcetype=ZZZ http_status=500 OR http_status=502 "HighCostAPI"&lt;BR /&gt;| stats count by http_status, _time, pzInsKey&lt;BR /&gt;| fields http_status _time pzInsKey count&lt;BR /&gt;| addcoltotals count&lt;/P&gt;&lt;P&gt;I get the following results&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="eb1929_0-1610048280317.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12474i933775436EEFF1F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="eb1929_0-1610048280317.png" alt="eb1929_0-1610048280317.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Which is what we wanted originally, now the customer would like to have a count for the 500 errors and the 502 errors separately. I guess it wouldn't be necessary to split the http_status into 2 columns just as long as i can have a count for both.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 19:40:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535096#M151237</guid>
      <dc:creator>eb1929</dc:creator>
      <dc:date>2021-01-07T19:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting up data into multiple columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535102#M151239</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225210"&gt;@eb1929&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can count http_status codes separately like below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;host=XXX sourcetype=ZZZ http_status=500 OR http_status=502 "HighCostAPI"
| eval status_500=if(http_status==500,1,0)
| eval status_502=if(http_status==502,1,0)
| stats sum(status_500) as status_500 sum(status_502) as status_502 count by http_status, _time, pzInsKey
| fields http_status _time pzInsKey status_500 status_502 count
| addcoltotals status_500 status_502 count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you an upvote is appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 20:29:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535102#M151239</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-01-07T20:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting up data into multiple columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535115#M151241</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225210"&gt;@eb1929&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the appendpipe command to put 'subtotals' between the different status values like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;host=XXX sourcetype=ZZZ http_status=500 OR http_status=502 "HighCostAPI"
| stats count by http_status, _time, pzInsKey
| fields http_status _time pzInsKey count
| appendpipe [
  | stats sum(count) as count by http_status
  | eval pzInsKey="Total - Status code ".http_status
]
| sort http_status
&lt;/LI-CODE&gt;&lt;P&gt;which will give you a subtotal row with count as the total for the status. Note that the appendpipe also sets the pzInsKey field to a simple text string to indicate total.&lt;/P&gt;&lt;P&gt;In your dashboard you can then use a technique to highlight that subtotal row. (See dashboard examples Table Row Highlighting) for how to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 22:00:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535115#M151241</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-01-07T22:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting up data into multiple columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535884#M151482</link>
      <description>&lt;P&gt;That works thank you!!!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 17:31:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535884#M151482</guid>
      <dc:creator>eb1929</dc:creator>
      <dc:date>2021-01-14T17:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting up data into multiple columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535885#M151483</link>
      <description>&lt;P&gt;This one worked as well thank you both for this!!!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 17:32:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splitting-up-data-into-multiple-columns/m-p/535885#M151483</guid>
      <dc:creator>eb1929</dc:creator>
      <dc:date>2021-01-14T17:32:18Z</dc:date>
    </item>
  </channel>
</rss>

