<?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 chart over multiple fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500136#M195075</link>
    <description>&lt;P&gt;Try removing the tailing part of the command &lt;CODE&gt;|eval month=strftime(mon,"%B") |table month,year,Relevant,Missing,Non_Relevant | addtotals fieldname=Total Non_Relevant* Relevant* Missing*&lt;/CODE&gt; and test with only &lt;CODE&gt;...| rex field=Created_month_year "(?&amp;lt;month&amp;gt;\d+)\/(?&amp;lt;year&amp;gt;\d+)""&lt;/CODE&gt; to see if it works for u &lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2019 12:14:00 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-12-03T12:14:00Z</dc:date>
    <item>
      <title>how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500121#M195060</link>
      <description>&lt;P&gt;When I am using this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;chart count over Created_Month by Status
|table Created_Month,year,Relevant,Missing,Non_Relevant|addtotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I am getting only data for Created_month , but year field is populating empty:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Created_Month   year    Relevant    Missing Non_Relevant    Total
November                       0          2               4        6
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I retrieve &lt;CODE&gt;year&lt;/CODE&gt; field data ??&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 08:54:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500121#M195060</guid>
      <dc:creator>pavanraghav</dc:creator>
      <dc:date>2019-12-03T08:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500122#M195061</link>
      <description>&lt;P&gt;hi - the way to read SPL is from left to right pipes. So when you use this - &lt;BR /&gt;
chart count over Created_Month by Status&lt;BR /&gt;
there is no year field all subsequent pipes after that will have no reference to year as the chart command output does not contain a year value.&lt;BR /&gt;
What you can do is convert created_month to year by applying an eval ...something like this&lt;BR /&gt;
|chart count over Created_Month by Status|eval Year=subtsr(Created_Month,x.y)&lt;BR /&gt;
Now, your field Created_Month has to have some reference to year....something like 11-2019,12-2019,01-2020..and on&lt;BR /&gt;
If it doesn't then you need to modify yhr Ceated_Month field AND then apply some sort of string extraction eval function on it&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:13:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500122#M195061</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-30T03:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500123#M195062</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/217704"&gt;@pavanraghav&lt;/a&gt;,&lt;/P&gt;

&lt;P&gt;In case you didn't know, &lt;CODE&gt;chart&lt;/CODE&gt; is a transforming command : &lt;A href="https://docs.splunk.com/Splexicon:Transformingcommand" target="_blank"&gt;https://docs.splunk.com/Splexicon:Transformingcommand&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This means that after you run it you will only have the fields that are included in your command. In your case with  :&lt;BR /&gt;
&lt;CODE&gt;chart count over Created_Month by Status&lt;/CODE&gt; &lt;BR /&gt;
You will not have the year field.&lt;/P&gt;

&lt;P&gt;If you wish to keep the year field make sure you include it with the month field before you make the chart. Make a field called Created_Month_Year that contains both. Then run your chart as follows : &lt;BR /&gt;
&lt;CODE&gt;chart count over Created_Month_Year  by Status&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;After that all you have to do is extract and separate the month and year field from Created_Month_Year.&lt;/P&gt;

&lt;P&gt;Let me know if that helps.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:14:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500123#M195062</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2020-09-30T03:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500124#M195063</link>
      <description>&lt;P&gt;Hi David ,&lt;/P&gt;

&lt;P&gt;i have followed the steps which you have suggested &lt;/P&gt;

&lt;P&gt;Created_month_year  Relevant    Missing Non_Relevant    Total&lt;BR /&gt;
11/2019                                  0              2                 4                6&lt;/P&gt;

&lt;P&gt;But i need the result as :&lt;BR /&gt;
Month         year &lt;BR /&gt;
November  2019 &lt;/P&gt;

&lt;P&gt;and also when i get this output , is there a way where my addtotals command should add only values in fields ( relevant , missing and non_relevant ) .&lt;/P&gt;

&lt;P&gt;thanks in advance !&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:14:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500124#M195063</guid>
      <dc:creator>pavanraghav</dc:creator>
      <dc:date>2020-09-30T03:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500125#M195064</link>
      <description>&lt;P&gt;Cool, nice work &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/217704"&gt;@pavanraghav&lt;/a&gt;.&lt;/P&gt;

&lt;P&gt;In order to get November 2019 the next step is to split Created_month_year into month and year. To do so you can either use the &lt;CODE&gt;rex&lt;/CODE&gt;, the &lt;CODE&gt;subtsr&lt;/CODE&gt; function of eval or the &lt;CODE&gt;split&lt;/CODE&gt;function. I would say the easiest would be to do it with &lt;CODE&gt;rex&lt;/CODE&gt; as follows : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=Created_month_year "(?&amp;lt;month&amp;gt;\d+)\/(?&amp;lt;year&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As for the &lt;CODE&gt;addtotals&lt;/CODE&gt; there should be no issues if you have empty fields. if they are bugging you then you can use &lt;CODE&gt;fillnull&lt;/CODE&gt; and replace null values with zeros. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:14:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500125#M195064</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2020-09-30T03:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500126#M195065</link>
      <description>&lt;P&gt;ya sorted it out the same way &lt;/P&gt;

&lt;P&gt;Anyways thanks for your support &lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 11:03:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500126#M195065</guid>
      <dc:creator>pavanraghav</dc:creator>
      <dc:date>2019-12-03T11:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500127#M195066</link>
      <description>&lt;P&gt;great ! Please upvote and accept the answer if it was helpful !&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 11:05:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500127#M195066</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-03T11:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500128#M195067</link>
      <description>&lt;P&gt;regarding addtotals , the issue is not on the blank fields ,&lt;BR /&gt;
but since the command sums up all the numeric values , it is considering year also as value .&lt;BR /&gt;
we require only total of missing , relevant and non_relevant fields&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 11:24:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500128#M195067</guid>
      <dc:creator>pavanraghav</dc:creator>
      <dc:date>2019-12-03T11:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500129#M195068</link>
      <description>&lt;P&gt;why don't you just add an eval instead of using addtotals&lt;BR /&gt;
|eval sum=missing+releavant+non_relevant etc etc?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 11:28:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500129#M195068</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-12-03T11:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500130#M195069</link>
      <description>&lt;P&gt;ya i tried other way addtotals fieldname=Total Non_Relevant* Relevant* Missing*&lt;/P&gt;

&lt;P&gt;it is working &lt;/P&gt;

&lt;P&gt;I will try our suggestion too&lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 11:39:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500130#M195069</guid>
      <dc:creator>pavanraghav</dc:creator>
      <dc:date>2019-12-03T11:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500131#M195070</link>
      <description>&lt;P&gt;Hi everyone, &lt;/P&gt;

&lt;P&gt;thanks a lot for suggestions &lt;/P&gt;

&lt;P&gt;I need a help in understanding the below query in detail : &lt;/P&gt;

&lt;P&gt;| eval e="$time_token.earliest$", l="$time_token.latest$"| eval e=case(match(e,"^\d+$"),e,e="" OR e="now" , "0" , true(), relative_time(now(),e)) | eval l=case(match(l,"^\d+$"),l,l="" OR l="now" , "2145916800", true(), relative_time(now(),l))| eval e=tonumber(e) , l=tonumber(l) | where order_date &amp;gt;= e AND order_date &amp;lt;= l&lt;/P&gt;

&lt;P&gt;Can you guys help me out ??&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500131#M195070</guid>
      <dc:creator>pavanraghav</dc:creator>
      <dc:date>2020-09-30T03:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500132#M195071</link>
      <description>&lt;P&gt;Hi @pavanraghav,&lt;/P&gt;

&lt;P&gt;This seems like another query than the original one of this post, go ahead and post a new question then link it here, we can work on it there.&lt;/P&gt;

&lt;P&gt;If the answer below covers your initial question then please accept it so we can move on to the next &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 11:51:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500132#M195071</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-03T11:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500133#M195072</link>
      <description>&lt;P&gt;ok &lt;BR /&gt;
 and regarding the above posted question &lt;/P&gt;

&lt;P&gt;rex field=Created_month_year "(?.&lt;EM&gt;)/(?.&lt;/EM&gt;)" |eval month=strftime(mon,"%B") |table month,year,Relevant,Missing,Non_Relevant | addtotals fieldname=Total Non_Relevant* Relevant* Missing*&lt;/P&gt;

&lt;P&gt;this is working fine when im using in the search &lt;BR /&gt;
but when im placing the same in the sourcecode of my dashboard it is throwing an error ,unexpected close tag for the line &lt;BR /&gt;
rex field=Created_month_year "(?.&lt;EM&gt;)/(?.&lt;/EM&gt;)" &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:14:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500133#M195072</guid>
      <dc:creator>pavanraghav</dc:creator>
      <dc:date>2020-09-30T03:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500134#M195073</link>
      <description>&lt;P&gt;could be the &lt;CODE&gt;/&lt;/CODE&gt;causing an issue, try using this instead : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=Created_month_year "(?&amp;lt;month&amp;gt;\d+)\/(?&amp;lt;year&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Dec 2019 11:59:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500134#M195073</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-03T11:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500135#M195074</link>
      <description>&lt;P&gt;tried not working &lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 12:09:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500135#M195074</guid>
      <dc:creator>pavanraghav</dc:creator>
      <dc:date>2019-12-03T12:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500136#M195075</link>
      <description>&lt;P&gt;Try removing the tailing part of the command &lt;CODE&gt;|eval month=strftime(mon,"%B") |table month,year,Relevant,Missing,Non_Relevant | addtotals fieldname=Total Non_Relevant* Relevant* Missing*&lt;/CODE&gt; and test with only &lt;CODE&gt;...| rex field=Created_month_year "(?&amp;lt;month&amp;gt;\d+)\/(?&amp;lt;year&amp;gt;\d+)""&lt;/CODE&gt; to see if it works for u &lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 12:14:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500136#M195075</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-03T12:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500137#M195076</link>
      <description>&lt;P&gt;nope still no progress&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 12:16:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500137#M195076</guid>
      <dc:creator>pavanraghav</dc:creator>
      <dc:date>2019-12-03T12:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500138#M195077</link>
      <description>&lt;P&gt;ummm, could you please paste the corresponding section of your code here ? &lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 12:23:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500138#M195077</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-03T12:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500139#M195078</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults count=2
| streamstats count
| eval _time = if (count==2,relative_time(_time,"-3month@d"), relative_time(_time,"@d"))
| makecontinuous span=1d
| eval count=random() % 3 + 1
| eval status=mvindex(split("Relevant,Missing,Non_Relevant",","),count - 1)
 `comment("this is sample data")`
| bin span=1month _time
| chart count over _time by status
| addtotals
| eval Created_Month=strftime(_time,"%B") ,year=strftime(_time,"%Y")
| table Created_Month, year, Relevant, Missing, Non_Relevant, Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think you should use &lt;CODE&gt;_time&lt;/CODE&gt;  until the end.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 12:49:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500139#M195078</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-03T12:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to chart over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500140#M195079</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Created_Month = Created_Month .  "/" . year
| chart count over Created_Month BY Status
| table Created_Month, Relevant, Missing, Non_Relevant
| addtotals
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 10:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-chart-over-multiple-fields/m-p/500140#M195079</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-04T10:41:24Z</dc:date>
    </item>
  </channel>
</rss>

