<?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: Need help combining 2 separate searches on different log files and show the results on a single timechart as 2 separate lines in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269870#M176810</link>
    <description>&lt;P&gt;I get how you use the OR to search both sources. But the field name is "responseTime" in both the log files. I would need to rename "responseTime" in the process_log to "processTime" before the timechart command. Where/How do I place the rename in your suggested query because I need to tell Splunk that the rename applies only to the process_log source.  &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 10:54:47 GMT</pubDate>
    <dc:creator>pdpsplunk100</dc:creator>
    <dc:date>2020-09-29T10:54:47Z</dc:date>
    <item>
      <title>Need help combining 2 separate searches on different log files and show the results on a single timechart as 2 separate lines</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269868#M176808</link>
      <description>&lt;P&gt;Hi - I'm having trouble in combining 2 separate searches and displaying the results on a single visualization (timechart). search 1 searches for events in the access log and search 2 searches for events in another log file (process log). Both log files have a field called "responseTime". In the process log the responseTime field represents "Processing Time". I'm able to run the searches independently and plot the timechart but when I combine them using join I don't get back any results. If I use append I get back results only from search 2. I am looking for 2 lines on the same timechart - one that represents processing time (from process log) and the other would be response time (from access log). &lt;/P&gt;

&lt;P&gt;search1: &lt;CODE&gt;index=xxx source=/x/x/x/localhost_access_log* field=value1&lt;/CODE&gt;&lt;BR /&gt;
search2: &lt;CODE&gt;index=xxx source=/x/x/x/process_log field=value2&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Using join I tried the following queries: (No results) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search1 | join [search2 | rename responseTime as processTime] | timechart avg(responseTime), avg(processTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(and)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search1 | timechart avg(responseTime) | join [search2 | timechart avg(responseTime)]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using append: (got back results only from search2)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search1 | append [search2 | rename responseTime as processTime] | timechart avg(responseTime), avg(processTime)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Sep 2016 00:50:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269868#M176808</guid>
      <dc:creator>pdpsplunk100</dc:creator>
      <dc:date>2016-09-08T00:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 separate searches on different log files and show the results on a single timechart as 2 separate lines</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269869#M176809</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxx (source=/x/x/x/localhost_access_log* OR source=/x/x/x/process_log )|timechart avg(responseTime) as responseTime, avg(processTime) as processTime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Sep 2016 09:27:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269869#M176809</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-09-08T09:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 separate searches on different log files and show the results on a single timechart as 2 separate lines</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269870#M176810</link>
      <description>&lt;P&gt;I get how you use the OR to search both sources. But the field name is "responseTime" in both the log files. I would need to rename "responseTime" in the process_log to "processTime" before the timechart command. Where/How do I place the rename in your suggested query because I need to tell Splunk that the rename applies only to the process_log source.  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:54:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269870#M176810</guid>
      <dc:creator>pdpsplunk100</dc:creator>
      <dc:date>2020-09-29T10:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 separate searches on different log files and show the results on a single timechart as 2 separate lines</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269871#M176811</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxx (source=/x/x/x/localhost_access_log* OR source=/x/x/x/process_log )| timechart avg(eval(match(source, "access") as  responseTime, avg(eval(match(source, "process") as processTime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Sep 2016 01:09:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269871#M176811</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-09T01:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 separate searches on different log files and show the results on a single timechart as 2 separate lines</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269872#M176812</link>
      <description>&lt;P&gt;Tried using match but that does not seem to work. I get eval expression is malformed and timechart syntax is incorrect. &lt;/P&gt;

&lt;P&gt;I was able to get what I wanted using the query below (using join). I'm still looking for ways to optimize the query as join is expensive but this does the job for now. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxx (source=/x/x/x/process_log AND request_param=xxx) | rename responseTime as processTime | timechart avg(processTime) as "Processing Time" | join _time [search index=xxx (source=/x/x/x/localhost_access_log* AND request_param=yyy) | timechart avg(responseTime) as "Response Time"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your guidance folks. &lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 22:38:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269872#M176812</guid>
      <dc:creator>pdpsplunk100</dc:creator>
      <dc:date>2016-09-09T22:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need help combining 2 separate searches on different log files and show the results on a single timechart as 2 separate lines</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269873#M176813</link>
      <description>&lt;P&gt;This did the trick. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxx (source=/x/x/x/process_log AND request_param=xxx) | rename responseTime as processTime | timechart avg(processTime) as "Processing Time" | join _time [search index=xxx (source=/x/x/x/localhost_access_log* AND request_param=yyy) | timechart avg(responseTime) as "Response Time"]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Sep 2016 22:40:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-combining-2-separate-searches-on-different-log-files/m-p/269873#M176813</guid>
      <dc:creator>pdpsplunk100</dc:creator>
      <dc:date>2016-09-09T22:40:07Z</dc:date>
    </item>
  </channel>
</rss>

