<?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: LOOKUP QUERY - TWO FIELDS in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652799#M225583</link>
    <description>&lt;P&gt;It is still unclear what "&lt;SPAN&gt;is related to" means. &amp;nbsp;Why is output from &lt;FONT face="courier new,courier"&gt;| stats count by Call.OrigParty.CallingPartyAddr Call.CallForwardInfo.LastRedirectingAddr&lt;/FONT&gt; "wrong"? &amp;nbsp;Without telling us what the expected result is, you are asking volunteers to read your mind. (Also, if possible, post tables in text. &amp;nbsp;Screenshot is terrible to work with.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Aug 2023 04:05:33 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-08-02T04:05:33Z</dc:date>
    <item>
      <title>How can I validate if the information of two fields of an index exist in a lookup table ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652479#M225513</link>
      <description>&lt;P&gt;hello engineers good afternoon&lt;/P&gt;
&lt;P&gt;I have a problem I hope you can help me to solve it.&lt;/P&gt;
&lt;P&gt;How can I do to validate if the information of two fields of an index exist in a lookup table ?&lt;/P&gt;
&lt;P&gt;I need to create two lookup files ?&lt;/P&gt;
&lt;P&gt;I was thinking to unite in the same column the information of the two fields and that to consult it to the lookup table.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 18:48:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652479#M225513</guid>
      <dc:creator>DG3bran</dc:creator>
      <dc:date>2023-07-31T18:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP QUERY - TWO FIELDS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652485#M225517</link>
      <description>&lt;P&gt;The use case needs more clarity. &amp;nbsp;What exactly do you mean by "&lt;SPAN&gt;exist in a lookup table?" &amp;nbsp;There are too many possibilities, including but not limited to:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The two field names merely exist in the lookup as column names?&lt;/LI&gt;&lt;LI&gt;The two fields in some events have matching values in the lookup?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The best way to describe a use case is to start with a data illustration, a lookup illustration, and a result illustration.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 02:11:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652485#M225517</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-31T02:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP QUERY - TWO FIELDS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652501#M225527</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249439"&gt;@DG3bran&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;said, your requirement isn't so clear:&lt;/P&gt;&lt;P&gt;let me summarize:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you have a search extracting two fields (field1 and field2),&lt;/LI&gt;&lt;LI&gt;you want to check if the values in these two fields are present in a lookup.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The questions are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;in the lookup you have two different fields (columns) containing the values to check or they are in one column?&lt;/LI&gt;&lt;LI&gt;do you want to check the presence of both the fields or at least one?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if they are in two columns, you have to use:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index [ | inputlookup your_lookup | fields field1 field2 ]&lt;/LI-CODE&gt;&lt;P&gt;if they are in one column (called e.g. my_field) to check in two fields, you can try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index ([ | inputlookup your_lookup | rename my_field AS field1 ] OR [ | inputlookup your_lookup | rename my_field AS field2 ])&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 06:03:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652501#M225527</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-31T06:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP QUERY - TWO FIELDS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652782#M225582</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; thankyou for you help&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you're right, I am not clear, I will try to explain it much better.&lt;/P&gt;&lt;P&gt;I need to perform two queries,&amp;nbsp; in the first one to get a value from the field "&lt;STRONG&gt;Call.OrigParty.CallingPartyAddr&lt;/STRONG&gt;" like this&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;index="cdr_cfs_index"&lt;BR /&gt;"Call.TermParty.TrunkGroup.TrunkGroupId"="2230" &lt;STRONG&gt;"Call.OrigParty.CallingPartyAddr"="*"&lt;/STRONG&gt;&lt;BR /&gt;| lookup DIDSMCM Call.OrigParty.CallingPartyAddr OUTPUT Call.OrigParty.CallingPartyAddr AS foundInLookup&lt;BR /&gt;| where isnull(foundInLookup) | stats count by &lt;STRONG&gt;Call.OrigParty.CallingPartyAddr&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.JPG" style="width: 700px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26585iDC46473F71C247B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.JPG" alt="1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this query it shows me all the numbers that are not in the lookup file and up to this point we are doing well.&lt;/P&gt;&lt;P&gt;But I need the result of the first query to now parse a new field "&lt;STRONG&gt;Call.CallForwardInfo.LastRedirectingAddr"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I tried the following query:&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;index="cdr_cfs_index"&lt;BR /&gt;"Call.TermParty.TrunkGroup.TrunkGroupId"="2230" "Call.OrigParty.CallingPartyAddr"="*" &lt;STRONG&gt;"Call.CallForwardInfo.LastRedirectingAddr"="*"&lt;/STRONG&gt;&lt;BR /&gt;| lookup DIDSMCM Call.OrigParty.CallingPartyAddr OUTPUT Call.OrigParty.CallingPartyAddr AS foundInLookup&lt;BR /&gt;| where isnull(foundInLookup) | stats count by Call.OrigParty.CallingPartyAddr &lt;STRONG&gt;Call.CallForwardInfo.LastRedirectingAddr&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but it matches everything in the second field omitting the information from the first query.&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.JPG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26586iDBDBC6C6CC72FEB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.JPG" alt="2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if there is a way to perform the first query and from the result to retrieve another field that is related to the first result and compare it with the lookup.&lt;/P&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 22:52:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652782#M225582</guid>
      <dc:creator>DG3bran</dc:creator>
      <dc:date>2023-08-01T22:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP QUERY - TWO FIELDS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652799#M225583</link>
      <description>&lt;P&gt;It is still unclear what "&lt;SPAN&gt;is related to" means. &amp;nbsp;Why is output from &lt;FONT face="courier new,courier"&gt;| stats count by Call.OrigParty.CallingPartyAddr Call.CallForwardInfo.LastRedirectingAddr&lt;/FONT&gt; "wrong"? &amp;nbsp;Without telling us what the expected result is, you are asking volunteers to read your mind. (Also, if possible, post tables in text. &amp;nbsp;Screenshot is terrible to work with.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 04:05:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652799#M225583</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-08-02T04:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP QUERY - TWO FIELDS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652807#M225584</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249439"&gt;@DG3bran&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: the first search is to have the list of all&amp;nbsp;&lt;STRONG&gt;"Call.OrigParty.CallingPartyAddr"&lt;/STRONG&gt;&amp;nbsp;present in the index but not in the lookup, is it correct?&lt;/P&gt;&lt;P&gt;if this is your requirement, you can simplify your first search in this way:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="cdr_cfs_index" "Call.OrigParty.CallingPartyAddr"="*"
"Call.TermParty.TrunkGroup.TrunkGroupId"="2230" NOT [ | inputlookup DIDSMCM | fields Call.OrigParty.CallingPartyAddr
| stats count by Call.OrigParty.CallingPartyAddr&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Instead it isn't clear for me what you want from the second search: is the new field&amp;nbsp;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;STRONG&gt;Call.CallForwardInfo.LastRedirectingAddr&lt;/STRONG&gt;" a field from the lookup or from the index?&lt;/P&gt;&lt;P&gt;do you want the count of events by both&amp;nbsp;&lt;SPAN&gt;Call.OrigParty.CallingPartyAddr and&amp;nbsp;&lt;/SPAN&gt;Call.CallForwardInfo.LastRedirectingAddr or by only the new field?&lt;/P&gt;&lt;P&gt;you can put the first search condition in the main search (using the solution I hinted for it).&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 05:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652807#M225584</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-08-02T05:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP QUERY - TWO FIELDS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652979#M225639</link>
      <description>&lt;P&gt;thank you for your time&lt;/P&gt;&lt;P&gt;This index, contains information of phone calls.&lt;/P&gt;&lt;P&gt;In the first query it works fine, now from the result of this field "Call.OrigParty.CallingPartyAddr" only some numbers also contain the field "Call.CallForwardInfo.LastRedirectingAddr" but only some, I would like to get those numbers from this field and go to compare again to the lookup.&lt;/P&gt;&lt;P&gt;The problem I have is that if I call both fields in the same query I get a match on the condition that both fields are present, and I stop seeing the numbers that only meet the first example.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 22:35:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652979#M225639</guid>
      <dc:creator>DG3bran</dc:creator>
      <dc:date>2023-08-02T22:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP QUERY - TWO FIELDS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652984#M225641</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;The problem I have is that if I call both fields in the same query I get a match on the condition that both fields are present, and I stop seeing the numbers that only meet the first example.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Let me try to understand. So, the problem is that the following two queries return different datasets.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="4.166666666666664%"&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="95.83333333333333%"&gt;&lt;SPAN&gt;index="cdr_cfs_index"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Call.TermParty.TrunkGroup.TrunkGroupId"="2230" &lt;/SPAN&gt;"Call.OrigParty.CallingPartyAddr"="*"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="4.166666666666664%"&gt;2&lt;/TD&gt;&lt;TD width="95.83333333333333%"&gt;&amp;nbsp;&lt;SPAN&gt;index="cdr_cfs_index"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Call.TermParty.TrunkGroup.TrunkGroupId"="2230" "Call.OrigParty.CallingPartyAddr"="*" &lt;/SPAN&gt;&lt;STRONG&gt;"Call.CallForwardInfo.LastRedirectingAddr"="*"&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Is that correct? &amp;nbsp;In other words, the lookup is just a confounding factor.&lt;/P&gt;&lt;P&gt;Have you tried OR operator? &amp;nbsp;Like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="cdr_cfs_index"
"Call.TermParty.TrunkGroup.TrunkGroupId"="2230" ("Call.OrigParty.CallingPartyAddr"="*" OR "Call.CallForwardInfo.LastRedirectingAddr"="*")
| lookup DIDSMCM Call.OrigParty.CallingPartyAddr OUTPUT Call.OrigParty.CallingPartyAddr AS foundInLookup
| where isnull(foundInLookup)
| stats count by Call.OrigParty.CallingPartyAddr Call.CallForwardInfo.LastRedirectingAddr&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Here, it is not clear what your expected output is, so I cannot tell if it meets your requirement or even if it will give you any result at all. &amp;nbsp;But at least that will give you all events that search 1 returns for lookup command.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 02:47:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-validate-if-the-information-of-two-fields-of-an-index/m-p/652984#M225641</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-08-03T02:47:10Z</dc:date>
    </item>
  </channel>
</rss>

