<?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: Searching a field using another field in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Searching-a-field-using-another-field/m-p/531053#M8585</link>
    <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;I applied this syntax. I'm getting the following error:&lt;BR /&gt;&lt;SPAN&gt;Error in 'where' command: The expression is malformed. Expected ).&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Nov 2020 19:56:58 GMT</pubDate>
    <dc:creator>ISP8055</dc:creator>
    <dc:date>2020-11-26T19:56:58Z</dc:date>
    <item>
      <title>Searching a field using another field</title>
      <link>https://community.splunk.com/t5/Reporting/Searching-a-field-using-another-field/m-p/531035#M8583</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;I want to search events for example A =B*xy&lt;BR /&gt;&lt;BR /&gt;Where B is another field name with different values depending on user input. * is the wildcard&lt;BR /&gt;&lt;BR /&gt;So. I'm looking for events where A would be NYabxy, NYccxy, etc. Here value of B is NY&lt;BR /&gt;&lt;BR /&gt;How would I do search syntax?&lt;BR /&gt;This doesn't work:&lt;BR /&gt;| search A=B*xy&lt;BR /&gt;as here B is considered a string not a field name.&lt;BR /&gt;&lt;BR /&gt;would&amp;nbsp;&lt;BR /&gt;"where" be better alternative?&lt;BR /&gt;&lt;BR /&gt;The main point of me doing this I wanna make my search more efficient as I want Splunk to only search events where A=NY*xy is applicable instead of searching every event with A field.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 16:48:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Searching-a-field-using-another-field/m-p/531035#M8583</guid>
      <dc:creator>ISP8055</dc:creator>
      <dc:date>2020-11-26T16:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a field using another field</title>
      <link>https://community.splunk.com/t5/Reporting/Searching-a-field-using-another-field/m-p/531044#M8584</link>
      <description>&lt;P&gt;Yes, &lt;FONT face="courier new,courier"&gt;where&lt;/FONT&gt; is better than &lt;FONT face="courier new,courier"&gt;search&lt;/FONT&gt; in this case.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;search&lt;/FONT&gt; command accepts only strings and patterns on the RHS whereas the &lt;FONT face="courier new,courier"&gt;where&lt;/FONT&gt; command also accepts fields and expressions.&amp;nbsp; You could do something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo A=*
| where match(A,B.".*xy")&lt;/LI-CODE&gt;&lt;P&gt;Here, the &lt;FONT face="courier new,courier"&gt;match&lt;/FONT&gt; function compares a field to a regular expression.&amp;nbsp; That regex is a concatention of field B, a wildcard (.*) and "xy".&lt;/P&gt;&lt;P&gt;Note that this does not save the indexers from reading all values of A, but it does filter A early so that helps some.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 17:49:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Searching-a-field-using-another-field/m-p/531044#M8584</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-11-26T17:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a field using another field</title>
      <link>https://community.splunk.com/t5/Reporting/Searching-a-field-using-another-field/m-p/531053#M8585</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;I applied this syntax. I'm getting the following error:&lt;BR /&gt;&lt;SPAN&gt;Error in 'where' command: The expression is malformed. Expected ).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 19:56:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Searching-a-field-using-another-field/m-p/531053#M8585</guid>
      <dc:creator>ISP8055</dc:creator>
      <dc:date>2020-11-26T19:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a field using another field</title>
      <link>https://community.splunk.com/t5/Reporting/Searching-a-field-using-another-field/m-p/531064#M8586</link>
      <description>&lt;P&gt;Hmm...&amp;nbsp; Try this alternative&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo A=*
| where match(A,'B' . ".*xy")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 26 Nov 2020 20:44:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Searching-a-field-using-another-field/m-p/531064#M8586</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-11-26T20:44:29Z</dc:date>
    </item>
  </channel>
</rss>

