<?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 count from raw lines? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-from-raw-lines/m-p/340355#M100949</link>
    <description>&lt;P&gt;Thanks @niketnilay for your great sharing. Ive done some changes in the props.conf and transform.conf. The output is exactly what I am expected.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
REPORT-fields=commafields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transform.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   [commafields]
    DELIMS = ","
    FIELDS = date_time, server, sensor, status, remark
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;MyBaseSearch&amp;gt; | chart count over server by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Mar 2018 02:37:42 GMT</pubDate>
    <dc:creator>ndiphe13</dc:creator>
    <dc:date>2018-03-14T02:37:42Z</dc:date>
    <item>
      <title>How to count from raw lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-from-raw-lines/m-p/340353#M100947</link>
      <description>&lt;P&gt;I have a lot of RAW data with this format:&lt;BR /&gt;
date_time,serverA,down&lt;BR /&gt;
date_time,serverB,down&lt;BR /&gt;
date_time,serverA,down&lt;BR /&gt;
date_time,serverA,down&lt;BR /&gt;
date_time,serverA,up&lt;BR /&gt;
date_time,serverB,up&lt;/P&gt;

&lt;P&gt;How to count that raw data so we can have the following result? &lt;BR /&gt;
server | up | down|&lt;BR /&gt;
serverA | 1 | 3 |&lt;BR /&gt;
serverB | 1 | 1 |&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Andi&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-from-raw-lines/m-p/340353#M100947</guid>
      <dc:creator>ndiphe13</dc:creator>
      <dc:date>2020-09-29T18:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to count from raw lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-from-raw-lines/m-p/340354#M100948</link>
      <description>&lt;P&gt;@ndiphe13, following is a run anywhere search based on the sample data and output provided in the question. The commands from &lt;CODE&gt;| makeresults&lt;/CODE&gt; till &lt;CODE&gt;| rename data as _raw&lt;/CODE&gt; generate the mock data. You can use your base search instead.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval data="date_time,serverA,down;date_time,serverB,down;date_time,serverA,down;date_time,serverA,down;date_time,serverA,up;date_time,serverB,up"
| makemv data delim=";" 
| mvexpand data
| rename data as _raw
| makemv _raw delim=","
| eval server=mvindex(_raw,1),status=mvindex(_raw,2)
| chart count over server by status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: Since you already have command delimited data, you can use &lt;CODE&gt;props.conf&lt;/CODE&gt; to generate the fields server and status during search time. That way you will not require &lt;CODE&gt;makemv&lt;/CODE&gt; and &lt;CODE&gt;eval&lt;/CODE&gt; commands&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;
| chart count over server by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Mar 2018 09:15:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-from-raw-lines/m-p/340354#M100948</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-13T09:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to count from raw lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-from-raw-lines/m-p/340355#M100949</link>
      <description>&lt;P&gt;Thanks @niketnilay for your great sharing. Ive done some changes in the props.conf and transform.conf. The output is exactly what I am expected.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
REPORT-fields=commafields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transform.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   [commafields]
    DELIMS = ","
    FIELDS = date_time, server, sensor, status, remark
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;MyBaseSearch&amp;gt; | chart count over server by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Mar 2018 02:37:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-from-raw-lines/m-p/340355#M100949</guid>
      <dc:creator>ndiphe13</dc:creator>
      <dc:date>2018-03-14T02:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to count from raw lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-from-raw-lines/m-p/340356#M100950</link>
      <description>&lt;P&gt;Perfect!!! Way to go. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 03:02:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-from-raw-lines/m-p/340356#M100950</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-14T03:02:41Z</dc:date>
    </item>
  </channel>
</rss>

