<?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 data from multiple files(log files) and then display it together in a pie chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425533#M121990</link>
    <description>&lt;P&gt;I loaded the files again with same index and this query worked fine. Thanks @renjith.nair.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Oct 2018 03:57:17 GMT</pubDate>
    <dc:creator>poojadevadas</dc:creator>
    <dc:date>2018-10-18T03:57:17Z</dc:date>
    <item>
      <title>how to get data from multiple files(log files) and then display it together in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425526#M121983</link>
      <description>&lt;P&gt;I have multiple Deployment log files:&lt;BR /&gt;
1. The first log file gives me all the logs related to the deployment in environment xxx. &lt;BR /&gt;
2. The second log file gives me all the logs related to the deployment in environment yyy. &lt;BR /&gt;
3. The third log file gives me all the logs related to the deployment in environment zzz. &lt;/P&gt;

&lt;P&gt;I'm calculating the duration of deployment in each environment by finding the difference between the endTime and the startTime using &lt;BR /&gt;
&lt;EM&gt;eval DurationSeconds = (endTime - startTime)&lt;/EM&gt; . And using this I'm able to find the time duration taken in each environment.&lt;/P&gt;

&lt;P&gt;Now I'm trying to collect data from all these 3 log files and then display all these data in the one pie chart so that we get to visualise the time taken for the deployment process in each environment in one single chart. &lt;BR /&gt;
Could someone please help me out with this.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 21:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425526#M121983</guid>
      <dc:creator>poojadevadas</dc:creator>
      <dc:date>2018-10-13T21:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to get data from multiple files(log files) and then display it together in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425527#M121984</link>
      <description>&lt;P&gt;@poojadevadas,&lt;/P&gt;

&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(source="xxx" OR source="yyy" OR source="zzz") |rex field=source "deploy(?&amp;lt;environment&amp;gt;\w+)"
|stats latest(startTime) as startTime,latest(endTime) as endTime by environment
|eval DurationSeconds = (endTime - startTime)
|stats values(DurationSeconds) by environment
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is a runanywhere example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|makeresults|eval env="xxx,yyy,zzz",duration="100,200,300"|makemv env delim=","|makemv duration delim=","
|eval x=mvzip(env,duration)|mvexpand x|eval x=split(x,",")|eval env=mvindex(x,0),duration=mvindex(x,1)|fields - x
|stats values(duration) by env&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;pie&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Oct 2018 04:23:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425527#M121984</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-14T04:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to get data from multiple files(log files) and then display it together in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425528#M121985</link>
      <description>&lt;P&gt;Hi @renjith.nair,&lt;/P&gt;

&lt;P&gt;This is very close to what I'm looking for . But I have one doubt as I'm very new to Splunk. My environment name is present in the log file name. For example:&lt;BR /&gt;
environment xxx -&amp;gt; deployxxx&lt;BR /&gt;
environment yyy -&amp;gt; deployyyy&lt;/P&gt;

&lt;P&gt;Is there a way I can extract the environment name from file name and then use in the query mentioned by you(above).&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 05:35:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425528#M121985</guid>
      <dc:creator>poojadevadas</dc:creator>
      <dc:date>2018-10-14T05:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to get data from multiple files(log files) and then display it together in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425529#M121986</link>
      <description>&lt;P&gt;@poojadevadas,&lt;BR /&gt;
No problem. If you have the string in your "source" filename, then try this to extract the environment.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;rex field=source "deploy(?&amp;lt;environment&amp;gt;\w+)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Updated the answer with the change. If its not working, please provide a sample filename&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 06:39:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425529#M121986</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-14T06:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to get data from multiple files(log files) and then display it together in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425530#M121987</link>
      <description>&lt;P&gt;Hi @renjith.nair ,&lt;BR /&gt;
I tried executing the query mentioned by you. I'm able to list down the environment names but the Time is shown as blank I.e.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;.                &lt;STRONG&gt;values(DurationSeconds)&lt;/STRONG&gt;&lt;BR /&gt;
xxx&lt;BR /&gt;
yyy&lt;BR /&gt;
zzz&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 16:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425530#M121987</guid>
      <dc:creator>poojadevadas</dc:creator>
      <dc:date>2018-10-14T16:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to get data from multiple files(log files) and then display it together in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425531#M121988</link>
      <description>&lt;P&gt;I used this query for only one environment(log file deployxxx.log) but was unable to find the duration between the first and last event in environment xxx.&lt;/P&gt;

&lt;P&gt;So used this:&lt;BR /&gt;
(source="deploy906.log") |rex field=source "deploy(?\w+)"&lt;BR /&gt;
&lt;STRONG&gt;|stats earliest(_time) as startTime latest(_time) as endTime by environment&lt;/STRONG&gt;&lt;BR /&gt;
|eval DurationSeconds = (endTime - startTime)&lt;BR /&gt;
|stats values(DurationSeconds) by environment&lt;/P&gt;

&lt;P&gt;Using this I was able to display the environment name as well as the duration for environment xxx. But when I added source="deployyyy" or source="deployzzz" in the same query, I was unable to find the duration. It jus displays the environment names but duration is left blank. Could you please help me with this.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:41:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425531#M121988</guid>
      <dc:creator>poojadevadas</dc:creator>
      <dc:date>2020-09-29T21:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to get data from multiple files(log files) and then display it together in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425532#M121989</link>
      <description>&lt;P&gt;@poojadevadas, do you have these sources in your splunk environment? I have added the source just based on the assumption that you have these sources as your log file sources.&lt;BR /&gt;
Just verify what are the source you are getting for this files xxx,yyy,zzz . Also are these from same index? if not you need to add the index as well. Would it be possible to add sample logs for each of this environment  (mask any sensitive data ), so that we can have a better idea. &lt;BR /&gt;
thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 03:49:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425532#M121989</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-15T03:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to get data from multiple files(log files) and then display it together in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425533#M121990</link>
      <description>&lt;P&gt;I loaded the files again with same index and this query worked fine. Thanks @renjith.nair.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 03:57:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425533#M121990</guid>
      <dc:creator>poojadevadas</dc:creator>
      <dc:date>2018-10-18T03:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to get data from multiple files(log files) and then display it together in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425534#M121991</link>
      <description>&lt;P&gt;I'm displaying the result as a pie chart. On click of a pie slice, I want another pie chart(based on each environment name) to be opened up and display some data specific to that pie slice(that specific environment). I checked in Splunk docs and found that I can use drilldown for this but unable to understand what field to mention. &lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 04:12:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425534#M121991</guid>
      <dc:creator>poojadevadas</dc:creator>
      <dc:date>2018-10-18T04:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to get data from multiple files(log files) and then display it together in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425535#M121992</link>
      <description>&lt;P&gt;@poojadevadas,In the pie chart options , add this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        &amp;lt;drilldown&amp;gt;
          &amp;lt;set token="env"&amp;gt;$click.value$&amp;lt;/set&amp;gt;
        &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 13:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-data-from-multiple-files-log-files-and-then-display/m-p/425535#M121992</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-19T13:41:11Z</dc:date>
    </item>
  </channel>
</rss>

