<?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: Custom Report with multiple fields in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311937#M4248</link>
    <description>&lt;P&gt;Thank you @NiketNilay and @MuS!!&lt;/P&gt;

&lt;P&gt;The problem was with the regular expression that was created by Splunk Field Extractor. Its working now.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Mar 2018 12:10:56 GMT</pubDate>
    <dc:creator>AdsicSplunk</dc:creator>
    <dc:date>2018-03-05T12:10:56Z</dc:date>
    <item>
      <title>Custom Report with multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311930#M4241</link>
      <description>&lt;P&gt;I have a report to generate which should have multiple fields for the data like below:-&lt;/P&gt;

&lt;P&gt;"10.10.10.10"   2015-09-15  15:54:55    POST    /services/service1  200&lt;BR /&gt;
"10.10.10.20"   2015-09-15  15:55:55    POST    /services/service2  200&lt;BR /&gt;
"10.10.10.30"   2015-09-15  15:56:55    POST    /services/service3  200&lt;BR /&gt;
"10.10.10.10"   2015-09-15  15:57:55    POST    /services/service1  200&lt;BR /&gt;
"10.10.10.20"   2015-09-15  16:00:55    POST    /services/service3  200&lt;/P&gt;

&lt;P&gt;The output should be like a table:-&lt;BR /&gt;
1. Serial Number :- 1, 2, 3, 4, 5&lt;BR /&gt;
2. Endpoint URI :- /services/service1, /services/service1, /services/service2, /services/service3, /services/service3&lt;BR /&gt;
3. Consumer :- Consumer1, Consumer2, Consumer3&lt;BR /&gt;
4. Total Count per Consumer per EndpointURI&lt;BR /&gt;
5. Error Count per Consumer per EndpointURI&lt;/P&gt;

&lt;P&gt;Report should look like:-&lt;/P&gt;

&lt;P&gt;Sr# EndpointURI          ConsumerIP HitCount ErrorCount &lt;BR /&gt;
1   /services/service1 10.10.10.10  100          3&lt;BR /&gt;&lt;BR /&gt;
2   /services/service1 10.10.10.20  0            0&lt;BR /&gt;&lt;BR /&gt;
3   /services/service1 10.10.10.30  150          1&lt;BR /&gt;&lt;BR /&gt;
4   /services/service2 10.10.10.10  640          2&lt;BR /&gt;&lt;BR /&gt;
5   /services/service3 10.10.10.20  10           0         &lt;/P&gt;

&lt;P&gt;How can I create something like above using chart, table or fields or any other commands in splunk search?&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2018 13:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311930#M4241</guid>
      <dc:creator>AdsicSplunk</dc:creator>
      <dc:date>2018-02-25T13:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report with multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311931#M4242</link>
      <description>&lt;P&gt;[UPDATED ANSWER]&lt;/P&gt;

&lt;P&gt;Based on the sample data provided please find the following run anywhere search it finds the total count of hits to and Endpoint URI from Specific IP and gives the Error Count as well. &lt;/P&gt;

&lt;P&gt;PS: As stated by @MuS your &lt;CODE&gt;rex&lt;/CODE&gt; command seems incorrect. So, I have provided Regular Expression as well. Replace the commands till &lt;CODE&gt;| rename data as _raw&lt;/CODE&gt; with your current base search and try the &lt;CODE&gt;rex&lt;/CODE&gt; and &lt;CODE&gt;stats&lt;/CODE&gt; command provided afterwards. Also if you are saving the result as a dashboard, you can turn on Serial Number through the Chart Configuration provided in the previous answer.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval data="\"10.10.10.10\" 2015-09-15 15:54:55 POST /services/service1 200;\"10.10.10.20\" 2015-09-15 15:55:55 POST /services/service2 200;\"10.10.10.30\" 2015-09-15 15:56:55 POST /services/service3 200;\"10.10.10.10\" 2015-09-15 15:57:55 POST /services/service1 404;\"10.10.10.20\" 2015-09-15 16:00:55 POST /services/service3 200;\"10.10.10.10\" 2015-09-15 15:54:55 POST /services/service1 200;\"10.10.10.20\" 2015-09-15 15:55:55 POST /services/service2 200;\"10.10.10.30\" 2015-09-15 15:56:55 POST /services/service2 200;\"10.10.10.10\" 2015-09-15 15:57:55 POST /services/service1 200;\"10.10.10.20\" 2015-09-15 16:00:55 POST /services/service2 400"
| makemv data delim=";"
| mvexpand data
| rename data as _raw
| rex "\"(?&amp;lt;ConsumerIP&amp;gt;[^\"]+)\"\s+(?&amp;lt;_time&amp;gt;\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2})\s(?&amp;lt;method&amp;gt;[^\s]+)\s(?&amp;lt;EndpointURI&amp;gt;[^\s]+)\s(?&amp;lt;status&amp;gt;\d+)"
| stats count as TotalHits count(eval(status!=200)) as ErrorCount by EndpointURI ConsumerIP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: I was under impression that your current field extractions are working as expected and you already have the required fields and you just needed the stats command.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;@AdsicSplunk, try the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;
| stats count as TotalHits count(eval(status!=200)) as ErrorCount by EndpointURI ConsumerIP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Once you save as a table you can use &lt;CODE&gt;Format Visualization&lt;/CODE&gt; option to turn on Serial Number. Following is corresponding Simple XML Configuration:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;option name="rowNumbers"&amp;gt;true&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Feb 2018 14:49:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311931#M4242</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-02-25T14:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report with multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311932#M4243</link>
      <description>&lt;P&gt;Thank you for your reply Niket.&lt;/P&gt;

&lt;P&gt;However, I am not receiving any result for this search. How is the value of status defined. What is status? Is it a variable? &lt;/P&gt;

&lt;P&gt;I am using below query with a regex for the log data with which i can at least receive the hit count per Endpoint URI.  But my requirement is like mentioned in the question. please advise.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="abcd" source="def" | rex _raw="^(?P[^\t]+)\t(?P[^\t]+)\t(?P[^\t]+)\t(?P\w+)\t(?P[^\t]+)\t(?P\d+)"  | chart usenull=f useother=f limit=0 count by EndpointURI | streamstats count as "SNo"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can a regex be used for this report as well. If yes, please advise.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 22:37:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311932#M4243</guid>
      <dc:creator>AdsicSplunk</dc:creator>
      <dc:date>2018-02-26T22:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report with multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311933#M4244</link>
      <description>&lt;P&gt;Hi there, is this just copy/paste gone wrong or do you have no names for your capturing groups?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 22:50:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311933#M4244</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-02-26T22:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report with multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311934#M4245</link>
      <description>&lt;P&gt;Hi Mus,&lt;/P&gt;

&lt;P&gt;Its copy paste gone wrong. I pasted the query with groups but I think it got omitted at the time of posting. Anyway, I have got a regex with which I can extract a part of the report like endpoint URI and total hit counts.&lt;/P&gt;

&lt;P&gt;However, I need help in creating full report. please advise.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 23:11:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311934#M4245</guid>
      <dc:creator>AdsicSplunk</dc:creator>
      <dc:date>2018-02-26T23:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report with multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311935#M4246</link>
      <description>&lt;P&gt;@niketnilay&lt;BR /&gt;
Could you please briefly explain what is to be done here?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 10:02:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311935#M4246</guid>
      <dc:creator>AdsicSplunk</dc:creator>
      <dc:date>2018-02-27T10:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report with multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311936#M4247</link>
      <description>&lt;P&gt;@AdsicSplunk, sorry for the delay in my response. I have updated my answer. Please try out and confirm!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2018 16:45:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311936#M4247</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-01T16:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report with multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311937#M4248</link>
      <description>&lt;P&gt;Thank you @NiketNilay and @MuS!!&lt;/P&gt;

&lt;P&gt;The problem was with the regular expression that was created by Splunk Field Extractor. Its working now.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 12:10:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Custom-Report-with-multiple-fields/m-p/311937#M4248</guid>
      <dc:creator>AdsicSplunk</dc:creator>
      <dc:date>2018-03-05T12:10:56Z</dc:date>
    </item>
  </channel>
</rss>

