<?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 Problems with subsearch. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227861#M175908</link>
    <description>&lt;P&gt;I  am having trouble getting a subsearch to work and was hoping someone might be able to help. I am trying to compare enterprise security hashes to another log/index I have that also has those same searches referenced. The index of that other log is "otherlog" in my sample. BridgeMsg is just a macro/field for a part of the syslog string. &lt;/P&gt;

&lt;P&gt;It is my understanding that inner joins are done first, so I am getting the event hash from ES, then I want to see if that result is in my otherlog. Obviously, I am missing something fundamental here though. I am also getting this error message and have no idea why:&lt;/P&gt;

&lt;P&gt;Error in 'dedup' command: The field '(' is specified multiple times. It should only be specified once. &lt;/P&gt;

&lt;P&gt;index=otherlog sourcetype=syslog | rex field=bridgeMsg "hash:\s+[\d.]+\s+(?&amp;lt;event_hash&amp;gt;(\S+))" | fields event_hash | dedup event_hash  [ search index=notable | search NOT &lt;CODE&gt;suppression&lt;/CODE&gt; | &lt;CODE&gt;get_event_hash&lt;/CODE&gt; |   dedup event_hash ]&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;BR /&gt;
(Edited to clarify as per comment 1)&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 12:22:17 GMT</pubDate>
    <dc:creator>lylereger</dc:creator>
    <dc:date>2020-09-29T12:22:17Z</dc:date>
    <item>
      <title>Problems with subsearch.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227861#M175908</link>
      <description>&lt;P&gt;I  am having trouble getting a subsearch to work and was hoping someone might be able to help. I am trying to compare enterprise security hashes to another log/index I have that also has those same searches referenced. The index of that other log is "otherlog" in my sample. BridgeMsg is just a macro/field for a part of the syslog string. &lt;/P&gt;

&lt;P&gt;It is my understanding that inner joins are done first, so I am getting the event hash from ES, then I want to see if that result is in my otherlog. Obviously, I am missing something fundamental here though. I am also getting this error message and have no idea why:&lt;/P&gt;

&lt;P&gt;Error in 'dedup' command: The field '(' is specified multiple times. It should only be specified once. &lt;/P&gt;

&lt;P&gt;index=otherlog sourcetype=syslog | rex field=bridgeMsg "hash:\s+[\d.]+\s+(?&amp;lt;event_hash&amp;gt;(\S+))" | fields event_hash | dedup event_hash  [ search index=notable | search NOT &lt;CODE&gt;suppression&lt;/CODE&gt; | &lt;CODE&gt;get_event_hash&lt;/CODE&gt; |   dedup event_hash ]&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;BR /&gt;
(Edited to clarify as per comment 1)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:22:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227861#M175908</guid>
      <dc:creator>lylereger</dc:creator>
      <dc:date>2020-09-29T12:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with subsearch.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227862#M175909</link>
      <description>&lt;P&gt;Hi lylereger, &lt;/P&gt;

&lt;P&gt;I think the rex syntax in your search is incorrect. A field name should be supplied to assign the captured group to. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=bridgeMsg "hash:\s+[\d.]+\s+(?&amp;lt;new_field&amp;gt;(\S+))" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For details, see documentation: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Rex"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Rex&lt;/A&gt; &lt;BR /&gt;
Not sure what new field you want to create with the regex capture, but please correct this syntax and try again. &lt;/P&gt;

&lt;P&gt;Hope this helps. Thanks! &lt;BR /&gt;
Hunter&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 15:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227862#M175909</guid>
      <dc:creator>hunters_splunk</dc:creator>
      <dc:date>2017-01-12T15:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with subsearch.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227863#M175910</link>
      <description>&lt;P&gt;That line does indeed have a field, I was bitten by cut and paste it seems. Hope it shows up in the tags. event_hash is the field.&lt;/P&gt;

&lt;PRE&gt;rex field=bridgeMsg "hash:\s+[\d.]+\s+(?&amp;lt;event_hash&amp;gt;(\S+))"&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jan 2017 15:43:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227863#M175910</guid>
      <dc:creator>lylereger</dc:creator>
      <dc:date>2017-01-12T15:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with subsearch.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227864#M175911</link>
      <description>&lt;P&gt;You want use the result of subsearch as filter, so it should be used with filtering command such as &lt;CODE&gt;| search&lt;/CODE&gt; or &lt;CODE&gt;| where&lt;/CODE&gt; (or in the base search itself. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=otherlog sourcetype=syslog | rex field=bridgeMsg "hash:\s+[\d.]+\s+(?&amp;lt;event_hash&amp;gt;(\S+))" | fields event_hash | dedup event_hash | search [ search index=notable | search NOT `suppression` | `get_event_hash` | dedup event_hash ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR (filter in base search and use event_hash value as text filter)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=otherlog sourcetype=syslog [ search index=notable | search NOT `suppression` | `get_event_hash` | dedup event_hash | table event_hash | rename event_hash as search ]| rex field=bridgeMsg "hash:\s+[\d.]+\s+(?&amp;lt;event_hash&amp;gt;(\S+))" | fields event_hash | dedup event_hash | search 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jan 2017 19:28:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227864#M175911</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-12T19:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with subsearch.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227865#M175912</link>
      <description>&lt;P&gt;I &lt;EM&gt;think&lt;/EM&gt; I am closer to the answer now, still need to do a lot of verification. For my needs, I think the second solution was a bit closer. Where I wound up:&lt;/P&gt;

&lt;PRE&gt;index=notable  source="*"  
| search NOT `suppression` 
| `get_event_hash` 
| dedup event_hash 
| fields * | table * 
| where  [search index=snaplec sourcetype=syslog-og | rex field=bridgeMsg hash:\s+[\d.]+\s+(?&amp;lt;event_hash&amp;gt;(\S+))"
    | fields event_hash 
    | dedup event_hash ]  
| table event_hash _time search_name
| rename event_hash as Notable, _time as Time, search_name as “Rule Name”

&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Jan 2017 22:58:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problems-with-subsearch/m-p/227865#M175912</guid>
      <dc:creator>lylereger</dc:creator>
      <dc:date>2017-01-16T22:58:31Z</dc:date>
    </item>
  </channel>
</rss>

