<?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: Bulk import users? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76925#M1079</link>
    <description>&lt;P&gt;Oh look, yes you did. Not sure how I missed that, sorry!&lt;/P&gt;</description>
    <pubDate>Thu, 01 Mar 2012 23:58:35 GMT</pubDate>
    <dc:creator>ChrisG</dc:creator>
    <dc:date>2012-03-01T23:58:35Z</dc:date>
    <item>
      <title>Bulk import users?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76921#M1075</link>
      <description>&lt;P&gt;I am using Splunk with SSO (Shibboleth) for authentication. Unfortunately, &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Usesinglesign-onwithSplunk#Set_up_users_in_Splunk_that_match_users_in_your_authentication_system"&gt;I still need to create a Splunk user for every user coming in through SSO&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;How can I bulk import users into Splunk, preferably from the command line?&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;There is a file named &lt;CODE&gt;$SPLUNK_HOME/etc/passwd&lt;/CODE&gt;. I have added users to this file, but they don't appear in the web interface under &lt;A href="http://splunk.example.org/en-US/manager/launcher/authentication/users"&gt;http://splunk.example.org/en-US/manager/launcher/authentication/users&lt;/A&gt; . In addition, Splunk removes users from this file periodically.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;The command &lt;CODE&gt;$SPLUNK_HOME/bin/splunk import userdata -dir /tmp/export.dat&lt;/CODE&gt;, but there is almost &lt;A href="http://docs.splunk.com/Special:SplunkSearch/docs?q=splunk+import"&gt;no documentation about this feature&lt;/A&gt;, and I cannot find anything which describes the format of export.dat . It looks as if this feature is really intended to export userdata from Splunk and import it to another Splunk instance, which is not what I am trying to do.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 22 Feb 2012 22:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76921#M1075</guid>
      <dc:creator>stefanlasiewski</dc:creator>
      <dc:date>2012-02-22T22:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk import users?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76922#M1076</link>
      <description>&lt;P&gt;It is the authz that require the user to be available in splunk, you can workaround by either &lt;BR /&gt;
creating a LDAP strategy pointing to your Shibboleth identity store if it is LDAP. &lt;BR /&gt;
or&lt;BR /&gt;
duplicating the Shibboleth user identities in the Splunk with proper role mapping&lt;BR /&gt;
I use a script like this to create a local splunk users&lt;/P&gt;

&lt;PRE&gt;
#!/bin/sh
FILE=$HOME/scripts/uids.txt
ACTION=$1

user_add()
{
line1=$1
curl -k  -u admin:changeme -X POST -d "name=$line&amp;amp;password=$line&amp;amp;roles=admin" https://localhost:8089/services/authentication/users
#curl -k  -u admin:changeme -X POST -d "name=$line&amp;amp;password=$line&amp;amp;roles=splunk_role_edit_tcp" https://localhost:8089/services/authentication/users
 echo "Creating User $line"
return 0
}
user_del()
{
line1=$1
curl -k  -u admin:changeme -X DELETE https://localhost:8089/services/authentication/users/$line1
 echo "Deleting User $line"
return 0
}
user_auth()
{
line1=$1
curl -k -X POST -d "username=$line1&amp;amp;password=$line1" https://localhost:8089/services/auth/login
 echo "Authenticating User $line"
return 0
}

cat $FILE|while read line
do
if [ $ACTION = "add" ]
then
 user_add $line
elif [ $ACTION = "del" ]
then
 user_del $line
else
 user_add $line
 user_auth $line
 user_del $line
fi
done 

&lt;/PRE&gt;

&lt;P&gt;my uids.txt is something like, I use uid/pwd same but you get the point&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
Lewis_User0&lt;BR /&gt;
Cesar_User1&lt;BR /&gt;
Mark_User2&lt;BR /&gt;
James_User3&lt;BR /&gt;
 &lt;/PRE&gt;&lt;BR /&gt;
 hope this helps&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76922#M1076</guid>
      <dc:creator>ithangasamy_spl</dc:creator>
      <dc:date>2020-09-28T11:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk import users?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76923#M1077</link>
      <description>&lt;P&gt;Have you tried adding users using a script with the CLI (import userdata)?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2012 00:56:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76923#M1077</guid>
      <dc:creator>ChrisG</dc:creator>
      <dc:date>2012-02-23T00:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk import users?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76924#M1078</link>
      <description>&lt;P&gt;Yes I have, which is why I mentioned &lt;CODE&gt;import userdata&lt;/CODE&gt; in my question.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2012 23:45:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76924#M1078</guid>
      <dc:creator>stefanlasiewski</dc:creator>
      <dc:date>2012-03-01T23:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk import users?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76925#M1079</link>
      <description>&lt;P&gt;Oh look, yes you did. Not sure how I missed that, sorry!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2012 23:58:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76925#M1079</guid>
      <dc:creator>ChrisG</dc:creator>
      <dc:date>2012-03-01T23:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk import users?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76926#M1080</link>
      <description>&lt;P&gt;Well, in the end I just ended up doing a loop like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;for USER in $USERLIST
do
    $SPLUNK_HOME/bin/splunk add user ${USER}@example.org -password jibberish
done
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Not quite a bulk import, but it gets the job done.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2012 23:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76926#M1080</guid>
      <dc:creator>stefanlasiewski</dc:creator>
      <dc:date>2012-03-21T23:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk import users?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76927#M1081</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
We have a scenario like one deployment server and two search heads. Can we bulk load the users from deployment servers for the searchheads?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 09:31:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Bulk-import-users/m-p/76927#M1081</guid>
      <dc:creator>premg</dc:creator>
      <dc:date>2014-03-11T09:31:48Z</dc:date>
    </item>
  </channel>
</rss>

