<?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 field and use it as &amp;quot;Text Form Input Element&amp;quot; in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139033#M28589</link>
    <description>&lt;P&gt;Klasse, danke dir&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jul 2014 14:02:40 GMT</pubDate>
    <dc:creator>HeinzWaescher</dc:creator>
    <dc:date>2014-07-15T14:02:40Z</dc:date>
    <item>
      <title>Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139021#M28577</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;is it possible to add field via lookup and use this as text form input element?&lt;BR /&gt;
I tried it out by using this xml, but it did not work:&lt;/P&gt;

&lt;P&gt;Here is my example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fieldset autoRun="true" submitButton="true"&amp;gt;
&amp;lt;input type="text" token="country_code" searchWhenChanged="true"&amp;gt;
&amp;lt;label&amp;gt;Enter an countrycode&amp;lt;/label&amp;gt;
&amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
&amp;lt;default/&amp;gt;
&amp;lt;/input&amp;gt;
&amp;lt;input type="time"&amp;gt;
&amp;lt;default&amp;gt;Today&amp;lt;/default&amp;gt;
&amp;lt;/input&amp;gt;
&amp;lt;/fieldset&amp;gt;
&amp;lt;row&amp;gt;
&amp;lt;table&amp;gt;
&amp;lt;title&amp;gt;test1&amp;lt;/title&amp;gt;
&amp;lt;searchString&amp;gt;sourcetype=A country_code=$country_code$
| lookup lookup.csv user OUTPUT country_code
| stats count&amp;lt;/searchString&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;BR&lt;BR /&gt;
Heinz&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 10:12:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139021#M28577</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2014-07-11T10:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139022#M28578</link>
      <description>&lt;P&gt;Did you try using the lookup search in the populatingSearch element of the Input?&lt;/P&gt;

&lt;P&gt;Edit: NVM that, misread the question...&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 10:28:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139022#M28578</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-11T10:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139023#M28579</link>
      <description>&lt;P&gt;Hi Martin,&lt;BR /&gt;
können wir wieder auf Deutsch umschwenken? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Ich bewege mich grad zum ersten mal auf diesem xml-Terrain und weiß nicht genau was du meinst. Wo könnte ich den lookup command evtl hinschieben?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 10:39:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139023#M28579</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2014-07-11T10:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139024#M28580</link>
      <description>&lt;P&gt;Na klar &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Jetzt lese ich erst, was du wirklich willst... Nutzer tippt &lt;CODE&gt;country_code&lt;/CODE&gt; ein, Splunk lädt den Lookup und filtert danach. Probier mal folgende Suche bei unverändertem XML:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=A [inputlookup lookup.csv | search country_code="$country_code$" | fields user] | stats Count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Das sucht nach den Usern, die im Lookup den jeweiligen &lt;CODE&gt;country_code&lt;/CODE&gt; haben... ohne vorher alle zu laden &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 11:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139024#M28580</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-11T11:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139025#M28581</link>
      <description>&lt;P&gt;Super, das funktioniert schon mal.&lt;BR /&gt;
Aber ist eine subsearch nicht unpraktisch, weil es ein Limit für die Ergebnisse gibt? Außerdem wird die Suche extrem langsam.&lt;BR /&gt;
Wäre es nicht besser die Events im nachhinein zu filtern, wenn der Lookup schon durch ist?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 11:34:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139025#M28581</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2014-07-11T11:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139026#M28582</link>
      <description>&lt;P&gt;z.B. so:&lt;/P&gt;

&lt;FIELDSET autorun="true" submitbutton="true"&gt;
&lt;INPUT type="text" token="country_code" searchwhenchanged="true" /&gt;
&lt;LABEL&gt;Enter an countrycode&lt;/LABEL&gt;
&lt;DEFAULT&gt;*&lt;/DEFAULT&gt;
&lt;DEFAULT&gt;&lt;/DEFAULT&gt;

&lt;INPUT type="time" /&gt;
&lt;DEFAULT&gt;Today&lt;/DEFAULT&gt;

&lt;/FIELDSET&gt;

&lt;P&gt;&lt;ROW&gt;&lt;BR /&gt;
&lt;TABLE&gt;&lt;BR /&gt;
&lt;TITLE&gt;test1&lt;/TITLE&gt;&lt;BR /&gt;
&lt;SEARCHSTRING&gt;sourcetype=A country_code=$country_code$&lt;BR /&gt;
| lookup lookup.csv user OUTPUT country_code&lt;BR /&gt;
| where country_code="$country_code$"&lt;BR /&gt;
| stats count&lt;/SEARCHSTRING&gt;"&lt;P&gt;&lt;/P&gt;

&lt;P&gt;scheint auf den ersten Blick zu funktionieren.&lt;BR /&gt;
dann ist allerdings kein ALL, * etc mehr möglich&lt;/P&gt;
&lt;/TABLE&gt;&lt;/ROW&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:02:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139026#M28582</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2020-09-28T17:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139027#M28583</link>
      <description>&lt;P&gt;Was schneller ist hängt vom Datensatz ab. Bei Millionen von Usern wird die subsearch fehlschlagen, bei wenigen Usern und vielen nicht-matchenden Events wird die andere Suche langsam sein, weil erst alle Events geladen werden müssen.&lt;BR /&gt;
Wie viele Einträge hat das größte Land im Lookup?&lt;/P&gt;

&lt;P&gt;Wenn du den zweiten Weg gehst, kannst du den Lookup als automatic konfigurieren, dann kannst du direkt in der ersten Suche danach filtern. Am alles-Laden-müssen ändert das allerdings nix.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 11:51:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139027#M28583</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-11T11:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139028#M28584</link>
      <description>&lt;P&gt;Schon mal vielen Dank für deine Hilfe!&lt;/P&gt;

&lt;P&gt;Es sind momentan über 400.000 Einträge im Lookup. Also muss ich wohl die zweite Variante nutzen.&lt;/P&gt;

&lt;P&gt;Ein automatic Lookup würde dann in jeder Suche mit dem sourcetype verwendet werden richtig? Wenn er nicht immer benötigt wird, macht es evtl mehr Sinn ihn nur bei Bedarf zu setzen um ansonsten Performance zu sparen.&lt;/P&gt;

&lt;P&gt;Welchen Unterschied macht es in obiger Suche eigentlich ob ich&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | where country_code="$country_code$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;oder &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | search country_code="$country_code$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Mit "search" könnten ja wildcards genutzt werden.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 12:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139028#M28584</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2014-07-11T12:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139029#M28585</link>
      <description>&lt;P&gt;400000 Einträge wäre kein Ding, wenn für einen &lt;CODE&gt;country_code&lt;/CODE&gt; nur ein Bruchteil davon zurückgegeben werden... aber tendentiell wird das nicht gleich verteilt sein.&lt;/P&gt;

&lt;P&gt;Der automatic lookup macht die Felder immer &lt;EM&gt;verfügbar&lt;/EM&gt;. Sie werden aber nicht immer geladen, zum Beispiel wenn du ein reporting command ohne Verwendung der Felder des Lookups anhängst und nicht anhand des Lookups filterst und nicht im verbose mode bist, wird der Lookup - wie alle unnötigen field extractions - nicht geladen.&lt;/P&gt;

&lt;P&gt;Schau in den job inspector was am meisten Zeit verbrät. Ich rate alles um &lt;CODE&gt;fetch&lt;/CODE&gt; herum, also Events laden.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 15:42:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139029#M28585</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-11T15:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139030#M28586</link>
      <description>&lt;P&gt;Klingt gut, dann werde ich es mal mit einem automatic lookup versuchen.&lt;BR /&gt;
Vielen Dank!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 11:19:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139030#M28586</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2014-07-15T11:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139031#M28587</link>
      <description>&lt;P&gt;Kannst du mir noch verraten, wie ich einen fest definierten Wert einfüge, sofern es keinen match beim automatic lookup gibt?&lt;/P&gt;

&lt;P&gt;Mit einem normalen lookup würde ich es so lösen:&lt;/P&gt;

&lt;P&gt;| lookup lookup.csv user OUTPUT country_code&lt;BR /&gt;
| fillnull valu="N/A" country_code&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:04:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139031#M28587</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2020-09-28T17:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139032#M28588</link>
      <description>&lt;P&gt;Klar - in der UI kannst du in der Lookup Definition unter Advanced Options die Minimum Matches auf 1 und die Default Matches auf "N/A" setzen. In transforms.conf übersetzt sich das dann in folgendes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[lookup_name]
filename = lookup.csv
min_matches = 1
default_matches = N/A
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Edit: so ein Denglisch &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 13:58:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139032#M28588</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-15T13:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139033#M28589</link>
      <description>&lt;P&gt;Klasse, danke dir&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 14:02:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139033#M28589</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2014-07-15T14:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup field and use it as "Text Form Input Element"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139034#M28590</link>
      <description>&lt;P&gt;Gerne - falls du mal vor-Ort-Hilfe brauchst...&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 14:08:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-field-and-use-it-as-quot-Text-Form-Input-Element-quot/m-p/139034#M28590</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-15T14:08:35Z</dc:date>
    </item>
  </channel>
</rss>

