<?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: Loops on csv file in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455575#M95008</link>
    <description>&lt;P&gt;could you give us an explication please ?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2019 13:37:04 GMT</pubDate>
    <dc:creator>kacel</dc:creator>
    <dc:date>2019-07-03T13:37:04Z</dc:date>
    <item>
      <title>Loops on csv file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455571#M95004</link>
      <description>&lt;P&gt;hi,&lt;BR /&gt;
i comeback to ask u again about my problem ;&lt;BR /&gt;
so :&lt;BR /&gt;
| inputlookup Obso_Inventory.csv&lt;BR /&gt;
| eval Compo=case(Composant="WAF", "LBWAF", Composant="LOAD BALANCER", "LBWAF", Composant="PROXY", "Browsing", Composant="FIREWALL", "Firewall", Composant="GATEWAY SSL", "Remote Access", Composant="GATEWAY SSL VPN", "Remote Access", Composant="IPS", "Anti-Intrusion", Composant="TAP", "Anti-Intrusion")&lt;BR /&gt;
|rename Compo as Composant&lt;BR /&gt;
| search   Composant="Firewall"  Editeur="&lt;EM&gt;" Metier="&lt;/EM&gt;" Platform="*" &lt;BR /&gt;
| foreach Hostname [eval temp = if(match(Parent,Hostname), "hello", "Noooooo") ]&lt;BR /&gt;
| table temp&lt;/P&gt;

&lt;P&gt;when i execut this the result is :&lt;BR /&gt;
Noooooo&lt;BR /&gt;
Noooooo&lt;BR /&gt;
Noooooo&lt;BR /&gt;
Noooooo&lt;BR /&gt;
Noooooo&lt;BR /&gt;
Noooooo&lt;/P&gt;

&lt;P&gt;the problem i me sur ther is a value from Parent that match Hostname&lt;BR /&gt;
i want to that retun hello .&lt;BR /&gt;
not only comparing in same raw that is the problem &lt;BR /&gt;
thank you &lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 10:25:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455571#M95004</guid>
      <dc:creator>kacel</dc:creator>
      <dc:date>2019-07-03T10:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Loops on csv file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455572#M95005</link>
      <description>&lt;P&gt;Parent and Hostname must match exactly.&lt;BR /&gt;
Please edit your query to show how the Parent and Hostname fields are obtained.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 12:29:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455572#M95005</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-07-03T12:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Loops on csv file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455573#M95006</link>
      <description>&lt;P&gt;@kacel,&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Obso_Inventory.csv
| eval Compo=case(Composant="WAF", "LBWAF", Composant="LOAD BALANCER", "LBWAF", Composant="PROXY", "Browsing", 
                  Composant="FIREWALL", "Firewall", Composant="GATEWAY SSL", "Remote Access", 
                  Composant="GATEWAY SSL VPN", "Remote Access", Composant="IPS", "Anti-Intrusion", 
                  Composant="TAP", "Anti-Intrusion")
|rename Compo as Composant
| search Composant="Firewall" Editeur="" Metier="" Platform="*" 
| eventstats values(Parent) as _tmp
| eval found=if(isnull(mvfind(_tmp,Hostname)),0,1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2019 12:51:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455573#M95006</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-07-03T12:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Loops on csv file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455574#M95007</link>
      <description>&lt;P&gt;Thank you very much the result shows 1 when it is a match and 0 else .&lt;/P&gt;

&lt;P&gt;its the best way to find same value of coulumn without using loops between two culumn&lt;BR /&gt;
thank u.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 13:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455574#M95007</guid>
      <dc:creator>kacel</dc:creator>
      <dc:date>2019-07-03T13:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Loops on csv file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455575#M95008</link>
      <description>&lt;P&gt;could you give us an explication please ?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 13:37:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455575#M95008</guid>
      <dc:creator>kacel</dc:creator>
      <dc:date>2019-07-03T13:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Loops on csv file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455576#M95009</link>
      <description>&lt;P&gt;sure. Last two lines can be rewritten as below to give a better idea&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventstats values(Parent) as tmp
 | eval found=if(isnull(mvfind(tmp,Hostname)),0,1)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;By using &lt;CODE&gt;eventstats&lt;/CODE&gt; we create a list of "Parents" for each row. Host name is then matched against this list which returns null for non-matching and an index for matching records . The result is then evaluated using &lt;CODE&gt;if&lt;/CODE&gt; and assigns to "found" . 1 and 0 can be replaced with any values for e.g. "Yes","No" etc&lt;/P&gt;

&lt;P&gt;Hope this helps! &lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 14:00:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Loops-on-csv-file/m-p/455576#M95009</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-07-03T14:00:09Z</dc:date>
    </item>
  </channel>
</rss>

