<?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: Subsearch / query with inputlookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656439#M226731</link>
    <description>&lt;P&gt;This is pretty much what I want, but there are other RunID lines that do not have the "general error" message that I want to capture also. So your example groups all RunID's and the MessageText with "general error".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need is, all RunID entries for the RunID with MessageText "general error".&lt;BR /&gt;&lt;BR /&gt;I.e:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;RunId&lt;/TD&gt;&lt;TD width="50%"&gt;MessageText&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;1&lt;/TD&gt;&lt;TD width="50%"&gt;Start&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;1&lt;/TD&gt;&lt;TD width="50%"&gt;There has been a general error.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;1&lt;/TD&gt;&lt;TD width="50%"&gt;Finish&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Start&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I find the RunID 1 having the error and I want to output the start, finish and the error too. If that is possible, and in this example, not RunID 2.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Sep 2023 14:05:20 GMT</pubDate>
    <dc:creator>Cranie</dc:creator>
    <dc:date>2023-09-01T14:05:20Z</dc:date>
    <item>
      <title>Subsearch / query with inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656417#M226722</link>
      <description>&lt;P&gt;Apologies, I am quite new to Splunk so not sure if this is possible, I have the following simple query:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| inputlookup appJobLogs
| where match(MessageText, "(?i)general error")
| rex mode=sed field=MessageText "s/, /\n/g"
| sort RunStartTimeStamp asc, LogTimeStamp asc, LogID ASC&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works and gets the data I need for the error I am after, but, I want all associated values for the error by RunID.&lt;BR /&gt;&lt;BR /&gt;So the headers are:&lt;BR /&gt;Host, InvocationID, Name, LogID, LogTS, LogName, MessageID, MessageText, RunID, RunTS, RunName&lt;/P&gt;&lt;P&gt;I would like to do something like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup appJobLogs
| where RunID in [
  | search appJobLogs
  | where match(MessageText, "(?i)general error")
  | fields RunID
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried various forms and closest I got was a join which gave me the not found fields (should be fixable) but limited to 10,000 results so that seems like the wrong solution.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 11:50:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656417#M226722</guid>
      <dc:creator>Cranie</dc:creator>
      <dc:date>2023-09-01T11:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch / query with inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656421#M226724</link>
      <description>&lt;P&gt;If you want events grouped by one or more fields then you want the &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup appJobLogs
| where match(MessageText, "(?i)general error")
| rex mode=sed field=MessageText "s/, /\n/g"
| stats values(*) as * by RunID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 12:14:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656421#M226724</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-09-01T12:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch / query with inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656423#M226725</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup appJobLogs where [
  | search appJobLogs
  | where match(MessageText, "(?i)general error")
  | fields RunID
]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 01 Sep 2023 12:17:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656423#M226725</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-09-01T12:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch / query with inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656438#M226730</link>
      <description>&lt;P&gt;I got an error&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;"The 'NOT ()' filter could not be optimized for search results."&lt;BR /&gt;&lt;BR /&gt;I'll look into. Thanks for the suggestion&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 14:01:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656438#M226730</guid>
      <dc:creator>Cranie</dc:creator>
      <dc:date>2023-09-01T14:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch / query with inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656439#M226731</link>
      <description>&lt;P&gt;This is pretty much what I want, but there are other RunID lines that do not have the "general error" message that I want to capture also. So your example groups all RunID's and the MessageText with "general error".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need is, all RunID entries for the RunID with MessageText "general error".&lt;BR /&gt;&lt;BR /&gt;I.e:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;RunId&lt;/TD&gt;&lt;TD width="50%"&gt;MessageText&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;1&lt;/TD&gt;&lt;TD width="50%"&gt;Start&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;1&lt;/TD&gt;&lt;TD width="50%"&gt;There has been a general error.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;1&lt;/TD&gt;&lt;TD width="50%"&gt;Finish&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Start&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I find the RunID 1 having the error and I want to output the start, finish and the error too. If that is possible, and in this example, not RunID 2.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 14:05:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656439#M226731</guid>
      <dc:creator>Cranie</dc:creator>
      <dc:date>2023-09-01T14:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch / query with inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656441#M226733</link>
      <description>&lt;P&gt;After a little tweaking this gives the desired results:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| inputlookup appJobLogs
| search [ | inputlookup appJobLogs
| where match(MessageText, "(?i)general error")
| fields RunID
| uniq
| format
]
| rex mode=sed field=MessageText "s/, /\n/g"
| sort RunStartTimeStamp asc, LogTimeStamp asc, LogID ASC&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 01 Sep 2023 14:31:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-query-with-inputlookup/m-p/656441#M226733</guid>
      <dc:creator>Cranie</dc:creator>
      <dc:date>2023-09-01T14:31:37Z</dc:date>
    </item>
  </channel>
</rss>

